| Author |
How to give dynamic values in html:select
|
Micheal John
Ranch Hand
Joined: Nov 01, 2006
Posts: 344
|
|
I want to set the dynamic value for styleId. how to set? The below one is not working.. <html:select property="money" name="Output" styleId="<bean:write name='Output' property='flag'/>""> <html ption... </html:select> the generated html file for the above one <select name="money" id="<bean:write name='Output' property='flag'/>"> <option... </select> but, I want the generated html to be: <select name="money" id="Rupees"> <option... </select> <select name="money" id="Dollars"> <option... </select> Ruppes, Dollars are based on the flag attribute of the form bean.. How to aciheve this?
|
Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
The reason your code doesn't work is that you can't embed one custom tag inside another. If your web application is a Servlet version 2.4 application, you can simply use an EL expression. Example: styleId="${Output.flag}" If your application is Servlet 2.3 or earlier, you can accomplish the same thing by using the struts-el version of the tags. [ September 12, 2007: Message edited by: Merrill Higginson ]
|
Merrill
Consultant, Sima Solutions
|
 |
 |
|
|
subject: How to give dynamic values in html:select
|
|
|