04-25-2012 02:21 AM
hi, i want to hide some fields such as:-TextField,ButtonField,labelfield etc...on buton click.
For example: button1 and button2 are present in base class and after pressing button1 the control moves to next screeen where there are fields such as textfield & button ields which i want to hide and similarly when button2 is pressed the other fields should be visible and only few buttons should be hidden....
Solved! Go to Solution.
04-25-2012 03:28 AM
04-25-2012 04:42 AM
04-25-2012 04:47 AM
04-25-2012 06:33 AM
04-25-2012 06:46 AM
04-25-2012 07:02 AM
04-25-2012 07:05 AM - edited 04-25-2012 07:10 AM
"I have tried these already..........
--------------------------------------------------
---((TextField)name).getManager().delete(datetimef
---((ButtonField)selectfromMap).selectionDelete();
---selectfromMap.setEditable(false);
--------------------------------------------------
1) ((TextField)name).getManager().delete(datetimefiel
If you want to delete datetimefield, then the correct code would be:
datetimefield.getManager().delete(datetimefield);
2) (ButtonField)selectfromMap).selectionDelete();
SelectionDelete is intended to be used for Text Field where the user has selected a section of the Text. As the documentation says:
"By default, this method does nothing; custom fields that support deletion operations must override this method"
ButtonField does not implement this. By contrast, ActiveAutoTextEditField does.
3) selectfromMap.setEditable(false);
The documentation says:
"This method lets you change the style of this field by either adding, or removing, the Field.EDITABLE style."
So you can make the Field not editable, and it will look and behave differently, but not remove it.
In summary, the delete is the only option that will work, I suggest the reason it did not work for you was that you were not selecting the Field's manager correctly.
Edit:
I have not seen your latest post when I added the above.
In this case I suggest that you create a Manager that is added in the correct position, that, by default, does not contain any Fields. When the appropriate Button is clicked, add the Fields you want to that Manager. When the Fields should be deleted, use the Manager deleteAll() method to remove all the Fields you do not want to display. That should work for you.
05-16-2012 01:32 AM
the code successfully worked .............thanks Simon_hain and Peter Strange
05-16-2012 02:36 AM