Hi;
I currently study how to use CompoundPropertyConstraint but with little result.
I expect the rule which ensure at least one of companyAddress and companyHomePage should be required.I hope the following codes works.but it does not work well.
Besides,I try RequiredIfOthersPresent like this:Code:PropertyValueConstraint companyAddress = new PropertyValueConstraint( "companyAddress", required()); PropertyValueConstraint companyHomePage = new PropertyValueConstraint( "companyHomePage", required()); CompoundPropertyConstraint compund = new CompoundPropertyConstraint(new Or(companyHomePage,companyAddress)); add(compund);
It does not work as the doc says. anything wrong with my way to use?Code:add(new RequiredIfOthersPresent("companyAddress","companyHomePage"));
Regards
Luciss Li


Reply With Quote