Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: RADIOGROUP items built dynamically  (Read 24368 times)
Benjamin F.
Posts: 7


« 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.
Bernard M.
Four Js
Posts: 45


« Reply #1 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
Nuno G.
Posts: 38


« Reply #2 on: December 21, 2015, 11:06:07 am »

Hope this small snipper helps.
Good luck

* radiogroup.zip (4.9 KB - downloaded 1582 times.)
Nuno G.
Posts: 38


« Reply #3 on: December 21, 2015, 11:06:51 am »

Hope this small snippet helps

* radiogroup.zip (4.9 KB - downloaded 1514 times.)
Benjamin F.
Posts: 7


« Reply #4 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!!
Nuno G.
Posts: 38


« Reply #5 on: December 21, 2015, 06:11:33 pm »

My pleasure. Glad I could help.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines