Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynaValidatorForm Bean Parent/children config question

 
grace smith
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you may be able to...why don't you give it a try?
 
grace smith
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I tried. It did not work. That's why I have to define the ChildFormBean as the standard Java Bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic