Hi,

I'm using the nested extension to manage a bean that has a list of other
beans, but I'm having always the same problem that I'm unable to solve.

I have a first action that creates the action form to be showed in the next
jsp. This works and everything I need is in the response. The problem that I
have is after that, when I submit the form to the next action, no
information about the nested beans is there. The nested beans array list is
null.

Does anybody know what I'm doing wrong? Where can be the problem?

Thanks in advance.

Javier




Here I create the action form:

      AuDistrAdminForm auDistrAdminForm = (AuDistrAdminForm) form;

      auDistrAdminForm.setAggregationUnitId(auAux.getAggregationUnitId());
      auDistrAdminForm.setAuDescription(auAux.getDescription());
      ArrayList distributionBeanslist = new ArrayList();
      for(Iterator iter = auAux.getAuDistributionList().iterator();
iter.hasNext(); )
        {
        AUDistribution auDistribution = (AUDistribution) iter.next();
        AUDistributionBean auDistributionBean = new AUDistributionBean();

auDistributionBean.setAggregationUnitId(auDistribution.getAggregationUnitId(
));
        auDistributionBean.setEmployeeId(auDistribution.getEmployeeId());

auDistributionBean.setEmailAddress(auDistribution.getEmailAddress());
        auDistributionBean.setEmployeeName(auDistribution.getFirstName() + "
"
                                        +  auDistribution.getLastName());
        distributionBeanslist.add(auDistributionBean);
        }
      auDistrAdminForm.setDistributionList(distributionBeanslist);

      if ("request".equals(mapping.getScope()))
          request.setAttribute(mapping.getAttribute(), form);
      else
          session.setAttribute(mapping.getAttribute(), form);
      }



And here is the JSP content:

<html:form action="/saveAuDistrAdministration.do">
<bean:write name="auDistrAdminForm" property="aggregationUnitId"
filter="true"/>
<nested:hidden property="aggregationUnitId" />
<nested:text property="auDescription" />
<table width="86%" border="1" cellspacing="0">
<tr align="left">
  <td width="22%" class="bgGrey">
    <bean:message key="auDistAdmin.prompt.email"/>
  </td>
  <td width="18%" class="bgGrey">
    <bean:message key="auDistAdmin.prompt.identifier"/>
  </td>
  <td width="48%" class="bgGrey">
    <bean:message key="auDistAdmin.prompt.employeeName"/>
  </td>
  <td width="12%" class="bgGrey">&nbsp;</td>
</tr>

<nested:iterate property="distributionArray" >
    <tr>
      <td align="left"><nested:write property="emailAddress"
/><nested:hidden property="emailAddress" /></td>
      <td align="left"><nested:write property="employeeId" /><nested:hidden
property="employeeId" /></td>
      <td align="left"><nested:write property="employeeName"
/><nested:hidden property="employeeName" /></td>
      <td align="left"><nested:checkbox property="markedForDeletion" /></td>
    </tr>
</nested:iterate>

  </table><br>
<html:submit>Save</html:submit>
</html:form>




This is the action from getter that returns that nested beans array:

  public Object[] getDistributionArray()
    {
    return _DistributionList.toArray();
    }




And the struts-config file has the next lines:

    <form-bean name="auDistrAdminForm"
type="com.lapize.frs.form.AuDistrAdminForm"/>

    <action path="/auDistrAdministration"
type="com.lapize.frs.action.AuDistrAdminAction"
            name="auDistrAdminForm" scope="session" validate="false"
input="/auAdministration.jsp">
        <forward name="success" path="/auDistribution.jsp"/>
    </action>
    <action path="/saveAuDistrAdministration"
type="com.lapize.frs.action.SaveAuDistrAdminAction"
            name="auDistrAdminForm" scope="session" validate="false"
input="/auDistrAdministration">
        <forward name="success" path="/aggregationUnits.jsp"/>
    </action>



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

Reply via email to