• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

String[] field inside a field that is a bean array in a dynavalidator form

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a dynavalidator bean.
My valiadator works fine when the field types I specify in my validation.xml are
1. Simple Strings,
2. Simple String[]
3. A simple String field of a nested bean.
4. A simple String[] field of a nested bean.
5. A String field if a nested beanArray.

===>I am having trouble when the field is a String[] inside a nested bean array.







I give below the xml for reference






<form-bean name="bundlesForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="name" type="java.lang.String" />
<form-property name="simpleArray" type="java.lang.String[]" size="3" />
<form-property name="subform1" type="package1.Subform" />
<form-property name="subformarr" type="package1.Subform[]" size="2" />
</form-bean>

SubForm bean has foloowing fields:-
name="field1" type="java.lang.String"
name="field2" type="java.lang.String[]"

Here is a form from my validation.xml

<form name="bundlesForm">
<field property="name" depends="required">
<msg name="required" key="You have forgotten to enter the name." resource="false" />
</field>

<field property="simpleArray" depends="required">
<arg key="bundlesForm.error.simpleArray1" />
</field>
<field property="simpleArray" indexedListProperty="simpleArray" depends="required,integer">
<arg key="bundlesForm.error.simpleArray" />
</field>

<field property="subform1.field1" depends="required,integer">
<arg key="bundlesForm.error.subform1.field1" />
</field>
<field property="subform1.field2" depends="required">
<arg key="bundlesForm.error.subform1.field2x" />
</field>

<field property="subform1.field2" indexedListProperty="subform1.field2" depends="required,integer">
<arg key="bundlesForm.error.subform1.field2" />
</field>
<field property="subformarr" depends="required">
<arg key="bundlesForm.error.subformarr" />
</field>
<field property="field1" indexedListProperty="subformarr" depends="required,integer">
<arg key="bundlesForm.error.subformarr.field1" />
</field>
<field property="field2" indexedListProperty="subformarr" depends="required,integer">
<arg key="bundlesForm.error.subformarr.field2" />
</field>
</form>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic