It does not matter about building it dynamically, what matter is what
was selected when the form was submitted.

Only the selected values are transmitted back and they should all come
back in that array.



-----Original Message-----
From: netizen1 [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 03, 2003 4:16 PM
To: [EMAIL PROTECTED]
Subject: Advice with reading multiple html:selects


Hello,

  I have read the newsgroups regarding multiple selects.
  I have a multiple html:select control that starts out empty
  I populate the select control by using a textbox and an add button
  so it is filled dynamically.
  

  My html:select is:
  <html:select property="questionOptions" multiple="true" size="2" />

  which comes out like :
  <select name="questionOptions" multiple="multiple" size="2"
style="width:500 px; height: 61px"></select>

  I have an action Form that has:

  private String[] gstrQuestionOptions                        = null;

  public String[] getQuestionOptions()
  {
         return this.gstrQuestionOptions;
  }
  public void setQuestionOptions( String[] value )
  {
         this.gstrQuestionOptions = value;
  }

  Even in the validate i try the following
  System.out.println( getQuestionOptions().length ) and i get
  java.lang.NullPointerException

  Since the select control is dynamically populated would i have to
  use something like request.getParameterValues("questionOptions")
  instead?


  Thank you
  

-- 
Best regards,
 netizen1                          mailto:[EMAIL PROTECTED]



---------------------------------------------------------------------
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