Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Other approach to pre-select radio button

 
Jazzy Sanchez
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been searching on how to pre-select a radio button using struts tags, and so far, the only way is to define its value on its action form.

Is there other way to do it?
How about if I am going to use DynaValidatorForm?

Thanks!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as you set the property value prior to the point at which the JSP code is run, you can do it anywhere you like.

- In the Action class that forwards to the JSP.
Example: myForm.setRadioValue("xyz");
DynaForm Example: dynaForm.set("radioValue", "xyz");
- in the JSP itself
Example <c:set target="myForm" property="radioValue" value="xyz" />
DynaForm Example: <c:set target="myForm.map" property="radioValue" value="xyz" />
[ June 21, 2007: Message edited by: Merrill Higginson ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic