Hi all
I have problem with one of my submit buttons on my form ,
Each time the following submit is clicked <nested:submit
property="insertDepartment" > Add a new Dept </nested:submit>
I need to execute the setInsertDepartment method of the Form class, however
this also results in the reset method of the Form get called
Can I prevent the reset method being called or if it is called to do a
selective reset ?
I would like to retain the reset method as it is possible that the Form may
be reset to a default state .
The Form class is
public class CompanyForm extends ActionForm {
public CompanyForm() {
dept = new Vector();
dept.add(new org.volvic.Dept() );
name = "xxxxxxxxxxxx ";
registedOffice = "yyyyyyyyyyy";
}
public void setInsertDepartment(String temp ) {
System.out.println("@@@@@@@@@@@@@@ CompanyForm $$$$$$$$$$$$ java
bean Set " );
dept.add(new org.volvic.Dept() );
}
public void reset(org.apache.struts.action.ActionMapping actionMapping,
javax.servlet.http.HttpServletRequest httpServletRequest) {
System.out.println("@@@@@@@@@@@@@@@@@ RESET WAS CLICKED ") ;
dept = new Vector();
dept.add(new org.volvic.Dept() );
}
}
The following snippet is from the jsp
<nested:root name="company" >
<nested:form action="/showDept" >
<tr>
<nested:submit property="insertDepartment" > Add a new Dept
</nested:submit>
<tr> <td> Company Name : <td> <nested:write property="name" /> </tr>
<tr> <td colspan="2" > <i> is located at the following address </i> </tr>
<tr> <td> Address : <nested:write property="registedOffice" /> </tr>
<tr> <td colspan="2" > Departments available are </tr>
<table bgcolor="#F0F0F0" border="1" >
<nested:iterate property="dept" type="org.volvic.Dept" >
<tr> <td> <nested:write property="DName" /> <td> <nested:write
property="DLocation" />
<td> <nested:submit property="updateLocation" > update </nested:submit>
</tr>
</nested:iterate>
</table>
</nested:form>
</nested:root>
Rupinder
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]