• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

dynaValidatorForm Bean Parent/children config question

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic