Hi All,
        I have a JSP that contains 
  <bean:define id="notAssociated" name="editAssociationsForm"
property="notAssociatedInsts"/>
  <td>
    <html:select size="10" property="newAssociations" multiple="true"
style="width=206;">
     <html:options collection="notAssociated" property="value"
labelProperty="label"/>
    </html:select>
  </td>

notAssociated is an ArrayList of LabelValueBeans

when i submit the form containing this snippet it gets sent to an action
that contains  the following code
...
EditAssociationsForm assocForm = (EditAssociationsForm)form;
        String[] blah = assocForm.getNewAssociations();
        if(blah == null) {
            cat.debug("blah is null");
        }
        else {
            cat.debug("blah length=" + blah.length);
            for(int x=0; x<blah.length; x++) {
                cat.debug(blah[x]);
            }
        }
....

this is always printing "blah length=0"

the EditAssociationsForm contains the following
...
    private String[] newAssociations;
    
    public void reset(ActionMapping mapping, HttpServletRequest request) {

        selectedAccount = null;
        associatedInsts = null;
        notAssociatedInsts = null;     
        if(newAssociations != null) {
            System.out.println("newAssoc length=" + newAssociations.length);
            for(int i=0; i<newAssociations.length; i++) {
                System.out.println("assoc=" + newAssociations[i]);
            }
        }
        else {
            System.out.println("newAssociations is null");
        }
        newAssociations = new String[0];
    }

    public void setNewAssociations(String[] newAssociations) {
        System.out.println("newAssociations=" + newAssociations.length);
        newAssociations = newAssociations;
    }
    
    public String[] getNewAssociations() {
        return newAssociations;
    }
...

This prints "newAssociations is null" and "newAssociations=<num selected in
jsp>" which means reset is being called then the value is being set.  I
don't see any other print outs from this code to indicate reset is being
called again.

and my struts config contains
...
    <action path="/saveAssociations"
            type="com.tfp.admintool.account.SaveAssociationsAction"
            name="editAssociationsForm"
            scope="request"
            validate="false">
      <forward name="success" path="/main.jsp"/>
    </action>
...

Does anyone see why the reset appears to be getting called or why the length
of the array is always being set to 0?  

My head is starting to hurt from banging it against the wall...


Kimberly MacKellar
Thomson Financial Publishing
[EMAIL PROTECTED]


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

Reply via email to