• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Swamy Nathan
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • 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" />

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 property="simpleArray" depends="required">
<arg key="bundlesForm.error.simpleArray1" />
<field property="simpleArray" indexedListProperty="simpleArray" depends="required,integer">
<arg key="bundlesForm.error.simpleArray" />

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

<field property="subform1.field2" indexedListProperty="subform1.field2" depends="required,integer">
<arg key="bundlesForm.error.subform1.field2" />
<field property="subformarr" depends="required">
<arg key="bundlesForm.error.subformarr" />
<field property="field1" indexedListProperty="subformarr" depends="required,integer">
<arg key="bundlesForm.error.subformarr.field1" />
<field property="field2" indexedListProperty="subformarr" depends="required,integer">
<arg key="bundlesForm.error.subformarr.field2" />
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!