struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heritier Arnaud <>
Subject RE: dynamically setting the html:select property
Date Wed, 08 Aug 2001 13:11:03 GMT
When you use a parameter of a tag, it should be a text or a regexp.
if you write <html:select property="lookup#<%= idx %>" > the tag 
interpretor will see the string "lookup#" and suppose that the parameter 
shouldn't be evaluated.
To do this you should write this : <html:select 
property="<%=\"lookup#+idx\"%>" >


-----Message d'origine-----
De: []
Date:	mercredi 8 aout 2001 14:31
Objet:	dynamically setting the html:select property

Hi there,

inside an iterate tag I'm creating multiple textboxes and selects.

to unqiuely identify each item I am appending the index from the iteration
(idx) to the name; e.g.

<input type="text" name="rate#<bean:write name="idx"/>" maxlength="10"
value="<bean:write name="limitBean" property="rate" />">

I also need to do this for drop down selections. However I'm having some
problems with naming the selects dynamically.

<html:select property="lookup#<%= idx %>" >

didn't work, the result was <select name="lookup#<%= idx %>" >

I also tried setting an attribute on my form

<jsp:setProperty name="coverDetailsForm" property="lookupIdx" value="<%=
idx %>" />
                <html:select property="coverDetailsForm.lookupIdx" value="
<%= limitBean.getLimit().getLookupDataId().toString() %>" >
                     <html:options name="limitBean" property="values"
labelName="limitBean" labelProperty="labels"/>

the result was <select name="coverDetailsForm.lookupIdx" >

I've had to resort to scriptlets, please help..

thanks James

View raw message