04-14-2014 08:28 AM
Hi All,
I have a case in which I have 4 drop down menu, and a continue button, I want to make sure that a user cant continue until selection is been made on all the four or atleast from some of the drop down menu. how can I do that.
Solved! Go to Solution.
04-14-2014 10:01 AM
You should modify the code to become a User Interface Event Handler combined with a state machine (essentially put an event structure in the idle case).
In the INIT case, disable the continue button and init a shiftregister with an empty dataset (see two lines below).
In IDLE case, wait on user interaction (event structure).
If an event triggers, "encode" the source into a local dataset (shiftregister containing e.g. a boolean array or UInt8).
If all drop downs are present in the dataset, enable the continue button.
If continue button is pressed, leave IDLE to CONTINUE.
In CONTINUE, terminate the loop and read the selection done by the user.
Please consider to add a "CANCEL" button.
Norbert
04-14-2014 11:10 AM
@Norbert_B wrote:
You should modify the code to become a User Interface Event Handler combined with a state machine (essentially put an event structure in the idle case).
In the INIT case, disable the continue button and init a shiftregister with an empty dataset (see two lines below).
In IDLE case, wait on user interaction (event structure).
If an event triggers, "encode" the source into a local dataset (shiftregister containing e.g. a boolean array or UInt8).
If all drop downs are present in the dataset, enable the continue button.
If continue button is pressed, leave IDLE to CONTINUE.
In CONTINUE, terminate the loop and read the selection done by the user.
Please consider to add a "CANCEL" button.
Norbert
Hi Norbet,
Thank you, but is there an example to look at, as I couldnt understand your solution.
Thanks
04-14-2014 12:12 PM - edited 04-14-2014 12:19 PM
I believe what Norbert was suggesting is something like this:
With this code the "Continue button will be disabled and greyed untill a value change event has been registered on each of the four I32 controls. Note also that its always OK to Cancel (and the windows X is active so you won't anger your users) The caller should decide what to do if Canceled? is TRUE.
Modify as desired! the Attachment is saved back to 2012
You can safely delete the case structure....
Its a hold over from my VIT
04-15-2014 07:12 AM
@JÞB wrote:
I believe what Norbert was suggesting is something like this:
With this code the "Continue button will be disabled and greyed untill a value change event has been registered on each of the four I32 controls. Note also that its always OK to Cancel (and the windows X is active so you won't anger your users) The caller should decide what to do if Canceled? is TRUE.
Modify as desired! the Attachment is saved back to 2012
You can safely delete the case structure....
Its a hold over from my VIT
Hi Jeff,
Thank you,
I coutldnt understand when you say add P-node to populate the strings[], You mean should the replace the "ring" with p -node , also I cant bundle them as bundling strings p- node will have confilct of 2d array and 1d array with ctrlref.
Thanks
04-15-2014 08:23 AM
@AnkitG wrote:
Hi Jeff,
Thank you,
I coutldnt understand when you say add P-node to populate the strings[], You mean should the replace the "ring" with p -node , also I cant bundle them as bundling strings p- node will have confilct of 2d array and 1d array with ctrlref.
Thanks
I'm sorry If I my note was unclear. P-Node refered to "Property Node" and your original code used several property nodes to write the "Strings []" Values of the I32 ring controls. I did not import those functions into my example and the note was left to remind you that the code was not complete.. Add the property nodes, with dataflow dependance, before the event loop. The property nodes can (Should) be wired on the error chain to enforce order of execution.
04-15-2014 12:49 PM
Hi Jeff,
Thank you, I did implement the change, but I am having some problem the "continue" button is stuck .Is there something I am doing wrong.?
04-15-2014 02:27 PM
Not Stuck at all! the button is "Disabled" because thats what it is set too.
That constant there should be "Enabled"-
Hmmmm.... looking at the source code we can easilly see who wrote that bug in the first place. Shhhh.. don't tell on me.
04-15-2014 02:39 PM
Thanks a lot jeff, It did work