Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Benjamin F. on December 17, 2015, 10:00:22 pm



Title: RADIOGROUP items built dynamically
Post by: Benjamin F. on December 17, 2015, 10:00:22 pm
I'm trying to change specific items on a RADIOGROUP to be hidden or shown dynamically. I already have the data I need to determine whether they should be shown, but I don't know how to actually show it.

For example if I start with this:

RADIOGROUP rad_type = formonly.rad_type, ITEMS=((1,"1stChoice"),(2,"2ndChoice"), (3,"3rdChoice")), ORIENTATION=HORIZONTAL;

How can I hide 2ndChoice (for example)? I have fooled around with ui.Dialog.setActionHidden and ui.Form.setElementHidden but haven't been able to make the magic happen. Any advice is greatly appreciated. I'm using Genero Mobile 1.1 if that makes a difference.


Title: Re: RADIOGROUP items built dynamically
Post by: Bernard M. on December 18, 2015, 05:24:27 pm
Hi Benjamin,

This is actually not possible, RadioGroup items don't have the hidden attribute at all. Also modifying dynamically the RadioGroup list of items could lead into rendering/layout issues.

You could use a ComboBox instead. And using the ui.ComboBox class you can then add or remove items dynamically with the addItem()/removeItem() methods.

Regards,
Bernard


Title: Re: RADIOGROUP items built dynamically
Post by: Nuno G. on December 21, 2015, 11:06:07 am
Hope this small snipper helps.
Good luck


Title: Re: RADIOGROUP items built dynamically
Post by: Nuno G. on December 21, 2015, 11:06:51 am
Hope this small snippet helps


Title: Re: RADIOGROUP items built dynamically
Post by: Benjamin F. on December 21, 2015, 02:57:40 pm
Nuno G, that is extremely helpful. I bet there's a lot of stuff that could be customized that way that otherwise can't be. Thank you so much!!


Title: Re: RADIOGROUP items built dynamically
Post by: Nuno G. on December 21, 2015, 06:11:33 pm
My pleasure. Glad I could help.