Hi everyone,

I have a multi-row edit page with linked dropdowns which I render using 
logic:interate (using indexed properties)

The struts html tags documentation mentions about needing the reset trick 
for the html:select tag.

I'm a bit stuck how this java code should be applied in the reset method

set("qualifications[].institutionCode", "");  // ??? trying validator syntax 
doesnt work

(I also have some validWhen indexed validations which should fail, but 
sometimes pass 
- this seems typical behaviour for those properties which should be reset)

What is good practice in this situtation? Should I be getting the ArrayList 
off the form and iterating through the objects and just reset the properties 
which map to a select tag?

e.g.
      

  ArrayList qualifications = (ArrayList) get("qualifications");
        if (qualifications != null && !qualifications.isEmpty()) {
            Iterator iter = qualifications.iterator();
            while (iter.hasNext()) {
                AcademicQualification qual = (AcademicQualification) 
iter.next();
                qual.setInstitutionCode("");
                qual.setQualificationCode("");
            }
        }

 

Dyna validator form config:

    <form-bean name="AcademicQualificationForm" 
type="forms.AcademicQualificationForm">
      <form-property name="qualifications" type="java.util.ArrayList"/>
      <form-property name="otherQualifications" type="java.util.ArrayList"/>
</form-bean>

JSP code:

<logic:iterate id="qualifications" indexId="idx" 
name="AcademicQualificationForm" property="qualifications">

        <html-el:select indexed="true" name="qualifications" 
property="institutionCode" styleId="institutionCode${idx}" 
errorStyleClass="formFieldError">
          <html-el:option value=""><fmt:message key="common.select" 
/></html-el:option>
          <html-el:options collection="uniList" property="uniCode" 
labelProperty="description"/>
        </html-el:select>
...

</logic:iterate>


Thanks for any advice


**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************

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

Reply via email to