You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Linus Nikander <li...@nikander.net> on 2004/02/13 11:18:11 UTC

preslect

I'm having trouble pre-selecting one of the <html:options/> entries that are
generated by the below jsp code. Which attribute of which bean should i set
to which value ?

UnknownSportForm contains two ArrayLists one
called currentSportsList  and one called problematicOddsList. The
problematicOddsList is in turn made up of beans with the appropriate getters
and setters. currentSportsList also contains beans with getters and setters
for its values. What I want to do is preselect one of the sportType elements
in the select fields I generate. How do i accomplish this ?

-------- JSP - code -----------
  <html:select name="UnknownSportForm" property="<%=\"problematicOddsList[\"
+ i + \"].sportTypeId\"%>" size="3">
        <html:options collection="currentSportsList" property="sportTypeId"
labelProperty="sportType"/>
    </html:select>

-------- JSP - code -----------

//Linus Nikander - linus@nikander.net




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


[SOLVED] Re: preslect

Posted by Linus Nikander <li...@nikander.net>.
Solved it myself after a bit of experimenting. Presetting
="<%=\"problematicOddsList[\"
> + i + \"].sportTypeId\"%> to a valid sportTypeId did the trick.

//Linus


"Linus Nikander" <li...@nikander.net> wrote in message
news:c0i893$3i8$1@sea.gmane.org...
> I'm having trouble pre-selecting one of the <html:options/> entries that
are
> generated by the below jsp code. Which attribute of which bean should i
set
> to which value ?
>
> UnknownSportForm contains two ArrayLists one
> called currentSportsList  and one called problematicOddsList. The
> problematicOddsList is in turn made up of beans with the appropriate
getters
> and setters. currentSportsList also contains beans with getters and
setters
> for its values. What I want to do is preselect one of the sportType
elements
> in the select fields I generate. How do i accomplish this ?
>
> -------- JSP - code -----------
>   <html:select name="UnknownSportForm"
property="<%=\"problematicOddsList[\"
> + i + \"].sportTypeId\"%>" size="3">
>         <html:options collection="currentSportsList"
property="sportTypeId"
> labelProperty="sportType"/>
>     </html:select>
>
> -------- JSP - code -----------
>
> //Linus Nikander - linus@nikander.net




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