You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Garner Shawn <sh...@gmail.com> on 2006/09/11 22:39:58 UTC

[help] html-el:select in logic:iterate loop

I have a html-el:select in a logic loop and the values are not being
retained after submtitting the form and returning with a validation
action error.

The html-el:text fields values are being retained and they are in the
exact same object.


<logic:iterate id="address" type="mypackage.AddressVO" name="MyForm"
property="addresses" indexId="currIndex">
<html-el:text name="address" property="city" maxlength="19" size="19"
indexed="true"
									title="Please enter the city." tabindex="${(8 + ((currIndex *
7) + 4))}"/>
<html-el:select name="address" property="state" indexed="true"
tabindex="${(8 + ((currIndex * 7) + 5))}" title="Please select the
state.">
									
								<snapp:stateoptions/>

								</html-el:select>
</logic:iterate>

Any help?

Shawn

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [help] html-el:select in logic:iterate loop

Posted by Garner Shawn <sh...@gmail.com>.
I figured it out and fixed my code.
The options tag is responsible for rendering the selected attribute.
I kind of thought the select tag doEndTag would parse the evaluated
tag body and set the right one as selected.  I suppose not as
efficient if you did it that way.

Thanks,
Shawn



On 9/11/06, Garner Shawn <sh...@gmail.com> wrote:
> I have a html-el:select in a logic loop and the values are not being
> retained after submtitting the form and returning with a validation
> action error.
>
> The html-el:text fields values are being retained and they are in the
> exact same object.
>
>
> <logic:iterate id="address" type="mypackage.AddressVO" name="MyForm"
> property="addresses" indexId="currIndex">
> <html-el:text name="address" property="city" maxlength="19" size="19"
> indexed="true"
>                                                                         title="Please enter the city." tabindex="${(8 + ((currIndex *
> 7) + 4))}"/>
> <html-el:select name="address" property="state" indexed="true"
> tabindex="${(8 + ((currIndex * 7) + 5))}" title="Please select the
> state.">
>
>                                                                 <snapp:stateoptions/>
>
>                                                                 </html-el:select>
> </logic:iterate>
>
> Any help?
>
> Shawn
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org