Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

initialize html:radio

 
Fernando Dominguez
Ranch Hand
Posts: 108
Debian Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I would like to initialize a html:radio

I have a bean called FAQ wich has a boolean property called bandera so I would like to select one botton for default accordind to bandera property I also would like to disable the radio button if bandera is true.

Is it possible?

<html:radio property ="estado" value ="1" disabled="<c utvalue='${FAQ.bandera}'/>" /><span class="txt001">Validado
<html:radio property ="estado" value ="2" disabled="<c ut value='${FAQ.bandera}'/>" />
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't embed one custom tag inside another, so the code you've shown us won't work. However, if you use the struts-el version of the tags, you can simply substitute an EL expression in a tag attribute. Example:


Just make sure you have the struts-el.jar file in your WEB-INF/lib directory.

Regarding how to set the default value, simply have your action class set the value of the estado property before the page is displayed. For example, if you want the first button to be checked by default, put the following in the action class that forwards to this JSP:

[ May 10, 2007: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic