Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use Validation.xml for Action Form that contains object Type ?

 
Muhammad Faisal
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My action form just contains one attribute of type Profile. Profile has an attribute address that is of type Address. If i want to validate City, how do I do it using validation.xml file. If I use . (dot) to navigate from profile to Address, property attribute wont recognize it. I strictly want to use validation.xml file to do that.
-----------------------------------------------------
public final class profileForm extends ActionForm{

private Profile profile;

}

public class Profile {

String name
String phoneNumber
Address address

}


public class Address {

String Street;
String City;
String State;
String Zip;

}

This code is not working for us.
-----------------------------------------------------------
<form name="profileForm">
<field property="address.city" depends="required">
<arg key="profileForm.address.city" position="0"/>
</field>
</form>
-----------------------------------------------------------

[ May 24, 2005: Message edited by: Muhammad Faisal ]

[ May 24, 2005: Message edited by: Muhammad Faisal ]
[ May 24, 2005: Message edited by: Muhammad Faisal ]
 
Ryan Dillon
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you saying you have tried profile.address.city and it does not work?
ie:

<form name="profileForm">
<field property="profile.address.city" depends="required">
<arg key="profileForm.address.city" position="0"/>
</field>
</form>

I think this should work as long as the profile bean is not null and the address bean within that is not null.

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic