Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Android Security Essentials Live Lessons
this week in the
hide radio button
Joined: Oct 15, 2006
Feb 24, 2009 21:56:09
i have 3 radio button on my form, and i only want to display 1 radio button when i load page as the 2nd radio button should appear only 1st radio button is selected.
How do i hide the 2nd radio button? I try to use the following, but it doesn't work, i will still show all the radio button at 1 go.:
pSelect= new HtmlSelectOneRadio(); pItem1= new UISelectItem(); pItem2= new UISelectItem(); pItem3= new UISelectItem(); pSelect.setRendered(true); pItem1.setRendered(true); pItem2.setRendered(false); pItem3.setRendered(false);
can i use rendered attribute for selectItem? if no, what should i use?
Joined: Oct 08, 2006
Feb 25, 2009 06:22:51
You can't. Just accordingly generate/change the list on every request.
It is sorta covered in the
JavaRanch Style Guide
subject: hide radio button
UnChecking a single radio button
using jsp:include with page attribute as an expression
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014