Hello,

Here is a simple JSP page I set up so I could try to understand the <html:select/> possibilities. My problem is that I do manage to display a correct list extracted from a Collection, but that when I clic on the submit button, the choice is null inside the Action class. Below is the relevant code.

Thanks for anyone who could help


------------------

// ---------- JSP file :
[SNIP beginning of the JSP]

<%
  // "debug" object
  ArrayList list = new ArrayList();
  for (int i=0; i < 5; i++)
      list.add(new LabelValueBean("label " + i, "value " + i));
  pageContext.setAttribute("items", list, PageContext.PAGE_SCOPE);
%>


<html:form action="/select"> <html:select property="choice"> <html:options collection="items" property="value" labelProperty="label"/> </html:select> <html:submit/> </html:form>



//-------- SelectAction.java :
public class SelectAction extends Action {
  // simplified Action
  public ActionForward execute (...) {
    SelectForm selectForm = (SelectForm) form;
    if (selectForm.getChoice() != null)
        return mapping.findForward("ok");

    return mapping.findForward("ko");
  }
}

--
Stéphane ZUCKERMAN

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



Reply via email to