11-21-2018 07:25 AM
How can I hide the items if not selected in the radio button? In the vi below, I want to hide K and thickness (L) if conduction is not chosen and the same for Convection and radiation.
Solved! Go to Solution.
11-21-2018 07:32 AM - edited 11-21-2018 07:32 AM
Hi Jasem,
several options:
1. Use a tab container and place the corresponding items/controls on several pages. Name the pages the very same way as the options in the RadioButton and you could directly wire from radiobutton to tab control( local variable) to select each page…
2. Use property node for each control and show/hide the controls as needed. (This usually makes a very bad UX: you better enable/disable+gray those controls!)
3. Use a subpanel container. Show a subVI in the subpanel. Select the VI to be shown based on the radio button. (Similar to the LabVIEW options dialog: each selection ín the left listbox simply loads a new VI to the subpanel to the right!)
11-21-2018 08:15 AM
@GerdW wrote:
Hi Jasem,
several options:
1. Use a tab container and place the corresponding items/controls on several pages. Name the pages the very same way as the options in the RadioButton and you could directly wire from radiobutton to tab control( local variable) to select each page…
2. Use property node for each control and show/hide the controls as needed. (This usually makes a very bad UX: you better enable/disable+gray those controls!)
3. Use a subpanel container. Show a subVI in the subpanel. Select the VI to be shown based on the radio button. (Similar to the LabVIEW options dialog: each selection ín the left listbox simply loads a new VI to the subpanel to the right!)
I don't see much difference in the two methods described in 2, except that, in dev mode, you'll have a tough time finding the hidden control. In both cases, you would have property nodes in the same exact places performing similar actions.
11-21-2018 08:26 AM
Hi Bill,
I don't see much difference in the two methods described in 2
From UX (User eXperience) point of view it is annoying to show/hide controls (as long as you need to make the frontpanel as large as needed to show all of those controls). Making them disabled&grayed is recommended.
But the OP explicitely asked for "hiding", that's why I mentioned both options…
11-21-2018 09:27 AM
If using Gerds #2 i'd say it's good to Place the Controls in a cluster, that way you only need 1 Visible/Disable-node for each.
/Y
11-21-2018 09:54 AM
@Yamaeda wrote:
If using Gerds #2 i'd say it's good to Place the Controls in a cluster, that way you only need 1 Visible/Disable-node for each.
/Y
I would make an array of references of the controls and then just create a 2D array constant containing the state of each control based on the selection. Then you just use Index Array to get the states and a FOR loop to set the state for each control. This would be a simple subVI to write.