Hi,
In have an ActionForm which contains an object called 'Details' like so:
public class DetailsForm extends ActionForm
{
private Details details = new Details();
public void setDetails(Details details)
{
this.details = details;
}
public Details getDetails()
{
return details;
}
}
and the Details class contains two strings: name and reference, plus the getters and
setters.
Now the problem i have is that in my JSP i can render these values fine in text boxes.
I want the user to be able to change the values, submit the form and then save the
changes. However, I cannot find the way that will call the setters of the Details
object. Is this possible and how is it done? I have tried the following ways in my JSP:
Firstly, defined a bean and then used this bean definition to render my text boxes:
<bean:define id="detail" name="DetailsForm" property="details"/>
<html:text name="detail" property="name" style="width:150px"/>
<html:text name="detail" property="reference" style="width:150px"/>
<html:submit><bean:message key="button.save"/></html:submit>
Secondly, didnt define the bean using <bean:define> but instead did this:
<html:text name="DetailsForm" property="details.name" style="width:150px"/>
<html:text name="DetailsForm" property="details.reference" style="width:150px"/>
<html:submit><bean:message key="button.save"/></html:submit>
This didnt work either, I'm assuming because only the setters are being called, and
not get().set() like I want..
Is there any way to call the setters for a class within my ActionForm?? Any help would
be appreciated.
Claire :)