hide a Form Item

Its possible to hide a Form Item?

example: choicegroup.visible=false or similar

[92 byte] By [Pepetruenoa] at [2007-11-27 11:40:59]
# 1

Hi Pepetrueno

To the best of my knowledged, no, you cannot hide a form item. But you can remove it from the form and add it back later when you want to make it visible.

Check out the form methods to append / delete / delete all / set / insert..

I have made an application which uses this technique to remove irrelevant TextFields depending on selection from a ChoiceGroup. The ChoiceGroup and all fields are substituted with other items based on a CommandAction: this looks like a totally different form but is just the same old one with a different set of items.

I did this as a workaround for the j2me bug that throws NullPointerException when trying to SetConstraint on a TextField (could not make the field TextField.UNEDITABLE) and an unrelated bug in my MOTOROKR E6 (acknowledged by Motorola, no fix yet) which prevented a form from responding to ItemStateChanged after once losing the focus.

If you want to take a look at the functionality, it's available from http://www.GetJar.com/products/11268/HoleVol

regards, Darryl

Darryl.Burkea at 2007-7-29 17:35:10 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

many Thanks.

Pepetruenoa at 2007-7-29 17:35:10 > top of Java-index,Java Mobility Forums,Java ME Technologies...