permaculture playing cards*
The moose likes Struts and the fly likes populate data form different DyanactionForms in single JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "populate data form different DyanactionForms in single JSP" Watch "populate data form different DyanactionForms in single JSP" New topic
Author

populate data form different DyanactionForms in single JSP

Judy001
Greenhorn

Joined: Jun 06, 2006
Posts: 4
HI,
I want to display data from 2 different dynaActionFrom.That means my main screen contains multiple buttons. In that when i press address button, i have to populate master records data and 2(REG and COR buttons) more buttons. when i press REG button , i have to populate child's Register address in a table in same JSP similarly for COR button(for this correspondense adrress).

My struts-config file is..
<form-beans >
<form-bean name="clientListForm" type="com.avox.struts.form.ClientListForm" />
<form-bean name="ButtonsForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="addresses" type="java.util.ArrayList" />
<form-property name="names" type="java.util.ArrayList" />
<form-property name="urls" type="java.util.ArrayList" />
</form-bean>
<form-bean name="AddressForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="regaddress" type="java.util.ArrayList" />
<form-property name="coraddress" type="java.util.ArrayList" />
<action
attribute="ButtonsForm"
input="/jsp/clientList.jsp"
name="ButtonsForm"
parameter="method"
path="/ButtonsAction"
scope="request"
type="com.avox.struts.action.ButtonsAction">
<forward
name="button_address"
path="/jsp/buttons/Address.jsp"
contextRelative="true" />
<forward
name="button_name"
path="/jsp/buttons/Name.jsp"
contextRelative="true" />
<forward
name="button_urls"
path="/jsp/buttons/Reg.jsp"
contextRelative="true" />
<action
attribute="AddressForm"
input="/jsp/buttons/Address.jsp"
name="AddressForm"
parameter="method"
path="/AddressAction"
scope="request"
unknown="false"
type="com.avox.struts.action.AddressAction">
<forward
name="button_correspondence"
path="/jsp/buttons/Address.jsp"
contextRelative="true" />
<forward
name="button_register"
path="/jsp/buttons/Address.jsp"
contextRelative="true" />
</action>

Address.jsp
<body>
Master Address: <br><br>
<CENTER>
<table border="1" width="60%" rules="none">
<logic:empty name="ButtonsForm" property="maddress" >
<tr>
<td> NO Master Address Available</td>
</tr>
</logic:empty>
<logic:notEmpty name="ButtonsForm" property="maddress" >
<logic:iterate name="ButtonsForm" property="maddress" id="address" >
<tr>
<td><bean:write name="address" property="address" /></td>
</tr>
</logic:iterate>
</logic:notEmpty>
</table>
<br><br><br>
<html:form action="/AddressAction">
<TABLE border="0" width="60%">
<TR>

<TD align="center">
<html:submit property="method">
<bean:message key="button.register"/>
</html:submit>
</TD>
<TD align="center">
<html:submit property="method">
<bean:message key="button.correspondence"/>
</html:submit>
</TD>
</TR>
</TABLE>
</html:form>
</center>
Children Addresses:
<CENTER><br><br>

<table border="1" width="60%" rules="none">
<logic:empty name="AddressForm" property="addresses" >
<tr>
<td> NO Children Address Available</td>
</tr>
</logic:empty>
<logic:notEmpty name="AddressForm" property="addresses" >
<logic:iterate name="AddressForm" property="addresses" id="address" >
<tr>
<td><bean:write name="addresses" property="address" /></td>
</tr>
</logic:iterate>
</logic:notEmpty>
</table>

</CENTER>
</body>

Master address is working well when i press REG button iam getting error. i know that error meaning but i don't know how write code for that.how i can i populate data from 2 different beans.
could u please help me.

Thanks in advance
 
 
subject: populate data form different DyanactionForms in single JSP
 
Similar Threads
multiple forms data within sigle JSP page
Connection Closed
Struts validation not working
Struts Buttons
HTTP Status 500 -