aspose file tools*
The moose likes Struts and the fly likes String[] field inside a field that is a bean array in a dynavalidator form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "String[] field inside a field that is a bean array in a dynavalidator form" Watch "String[] field inside a field that is a bean array in a dynavalidator form" New topic
Author

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

Swamy Nathan
Ranch Hand

Joined: May 16, 2004
Posts: 187
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String[] field inside a field that is a bean array in a dynavalidator form