LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to have drop down menu in which we cant continue until selection is made

Solved!
Go to solution

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.

0 Kudos
Message 1 of 9
(2,799 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 9
(2,777 Views)

@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

0 Kudos
Message 3 of 9
(2,762 Views)

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.Simple UI (Events) 1_BD.png

 

Modify as desired!  the Attachment is saved back to 2012

 

You can safely delete the case structure.... 
Its a hold over from my VIT 


"Should be" isn't "Is" -Jay
Message 4 of 9
(2,748 Views)

@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.Simple UI (Events) 1_BD.png

 

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

0 Kudos
Message 5 of 9
(2,720 Views)

@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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 9
(2,708 Views)

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.?

0 Kudos
Message 7 of 9
(2,688 Views)
Solution
Accepted by topic author AnkitG

Not Stuck at all!  the button is "Disabled" because thats what it is set too.

Capture.PNG

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.


"Should be" isn't "Is" -Jay
Message 8 of 9
(2,675 Views)

Thanks a lot jeff, It did work

0 Kudos
Message 9 of 9
(2,669 Views)