Hi !

Look my sample:
### Form
    private ArrayList projektfilterliste;
    private String[] projektfilter;

### JSP

<html:select property="projektfilter" size="1" onchange="newProjektfilter()"
styleClass="input_area">
        <html:options collection="projektfilterliste" property="value"
labelProperty="label" />
</html:select>

### Action
ArrayList filterInhalt = new ArrayList();
filterInhalt.add(new LabelValueBean(
                getAllProjectsDescription(request),
                "One"));
filterInhalt.add(new LabelValueBean(
                getAllProjectsDescription(request),
                "Two"));
nextForm.setProjektfilterliste(filterInhalt);
request.setAttribute("projektfilterliste",filterInhalt);  // !!!
// Preselection
ArrayList preselectedFilter = new ArrayList();
                preselectedFilter.add("One");
nextForm.setProjektfilter(
                (String[]) preselectedFilter.toArray(new String[0])); // can multiple 
to


bye

Slobodan Kasterovic


--> -----Ursprungliche Nachricht-----
--> Von: Jason Vinson [mailto:[EMAIL PROTECTED]]
--> Gesendet: Mittwoch, 12. Februar 2003 13:51
--> An: Struts Users Mailing List
--> Betreff: html:options selected attribute
-->
-->
--> Hi folks,
-->
-->    There my be a simple answer to this that I am
--> overlooking, but I am populating a pull down select, and I
--> can't figure out a good way to set the selected attribute
--> to the first element.  I am using a collection (string
--> array) and my jsp has this code:
-->
-->      <td align=right colspan=6>
-->         <html:select name="spgQueuesForm"
--> property="queuesName" size="1">
-->           <html:options property="queuesName"/>
-->         </html:select>
-->       </td>
-->
--> All I want to do is have the first option selected, and it
--> is defaulting to the last option.
-->
--> any help?
-->
--> TIA,
--> Jason
-->
--> ------------------------------------------------------------
--> ---------
--> To unsubscribe, e-mail: [EMAIL PROTECTED]
--> For additional commands, e-mail: [EMAIL PROTECTED]
-->
-->


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to