aspose file tools*
The moose likes Struts and the fly likes dynaValidatorForm Bean Parent/children config question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dynaValidatorForm Bean Parent/children config question" Watch "dynaValidatorForm Bean Parent/children config question" New topic
Author

dynaValidatorForm Bean Parent/children config question

grace smith
Greenhorn

Joined: Jun 14, 2005
Posts: 23
Hello,

I have a jsp page which contains parent info input fields section and child info section. the contents are different in two sections. if user have more than one child, then click add more children button will expend the form and append one extra child section after the first one.

The struts-config.xml is as following. As you see, the <form-property name="children" type="ChildFormBean[]" /> is referencing "ChildFormBean" which currently is implemented as a standard hard-coded java bean. I am wondering is it possible I can also define the "ChildFormBean" in the struts-config.xml as a dynaActionForm bean and be referenced in the "selectPCP" DynaValidator" form bean ?


<form-bean
name="selectPCP"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="EmpSSN" type="java.lang.String" />
<form-property name="EmpFirstName" type="java.lang.String" />
<form-property name="EmpLastName" type="java.lang.String" />
<form-property name="EmpSuffix" type="java.lang.String" />
<form-property name="EmpDob" type="java.lang.String" />
<form-property name="EmpGender" type="java.lang.String" />
<form-property name="EmpHomePhone" type="java.lang.String" />
<form-property name="EmpWorkPhone" type="java.lang.String" />
<form-property name="EmpPCP" type="java.lang.String" />
<form-property name="EmpPcpName" type="java.lang.String" />
<form-property name="EmpCurPat" type="java.lang.String" />

<form-property name="SpsSSN" type="java.lang.String" />
<form-property name="SpsFirstName" type="java.lang.String" />
<form-property name="SpsLastName" type="java.lang.String" />
<form-property name="SpsSuffix" type="java.lang.String" />
<form-property name="SpsDob" type="java.lang.String" />
<form-property name="SpsGender" type="java.lang.String" />
<form-property name="SpsPCP" type="java.lang.String" />
<form-property name="SpsPcpName" type="java.lang.String" />
<form-property name="SpsCurPat" type="java.lang.String" />

<form-property name="children" type="ChildFormBean[]" />

</form-bean>
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
you may be able to...why don't you give it a try?


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
grace smith
Greenhorn

Joined: Jun 14, 2005
Posts: 23
Yes, I tried. It did not work. That's why I have to define the ChildFormBean as the standard Java Bean.
 
Don't get me started about those stupid light bulbs.
 
subject: dynaValidatorForm Bean Parent/children config question