Required Object Validation Sample

Topics: Developer Forum, User Forum
Mar 26, 2008 at 5:57 AM
I have a customer object with a address

how do define that the address is required.

I just need the syntax of how it is defined in xml file.

<property name="Address">
<rule errorMessage="Please select a Address."
typeName="???"
useErrorMessageProvider="true"/>
</property>

Please advice on how to do this.

Thanks in advance.
Coordinator
Mar 26, 2008 at 11:27 AM
Assuming Address is an object
<property name="Address">
<rule errorMessage="Please select a Address."
typeName="RequiredObjectRule"/> 
</property>

If Address is a string
<property name="Address">
<rule errorMessage="Please select a Address."
typeName="RequiredStringRule"/> 
</property>
Also, just out of curiosity, are you actually using an IErrorMessageProvider