I am currently working on using Perspective for a mobile app. My current goal is to have a “Confirm” prompt appear after a user enters in a new value for a field. Since I am sure the fancy “thought balloon” for the One-Shot buttons is only available for that component, I was going to try using system.gui.confirm script in an event. The closest event I am finding are “onCompositionEnd” in the Text Composition Events, but I am not sure if it is triggering by touching “Done” or “Return” on my iPhone on-screen keypad.
Am I using the correct event for this, or are the Text Composition Events intended for other components?
Well, leaving aside the problem of which event to use, system.gui.confirm, despite the namespace, is not a function that will work in Perspective; only in Vision. Within Perspective, you’ll have to ‘roll-your-own’ popups and open them, and retrieve the value(s) the user submitted.
I would include a valueChanged script to open a Popup. Depending on what actions you want the confirmation Popup to provide, you’ll probably need to also set up a message handler on the Numeric Entry Field, as well as place some system.perspective.sendMessage calls on the Popup buttons.
Thanks for the clarification on system.gui.confirm, as well as a proposed solution for my issue. However, I am not seeing a “valueChanged” event for the Numeric Entry Field component, instead the closest event being “onCompositionEnd”. I tried adding a Logout action to this event, but I could not get it to trigger (assuming that it is triggered when the field is updated upon touching “Done” or “Return” on my iPhone on-screen keypad). Is the “onCompositionEnd” event supported in the Numeric Entry Field? If not, is there a different component I should be using? Thanks for your help.
UPDATE: Upon further testing, I found that the “onActionPerformed” event of the Component Events triggered after updating the Numeric Entry Field’s value. I will continue on with your suggested method. Thanks!
UPDATE: I just found a more detailed description of that suggested method here. Thanks again!
The change script can be found by right-clicking any property in the Property Editor. If there is no change script currently in place, you’ll see “Add Change Script”. This script will execute whenever the property changes.