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.
Code:
PropertyValueConstraint companyAddress = new PropertyValueConstraint(
                        "companyAddress", required());

PropertyValueConstraint companyHomePage = new PropertyValueConstraint(
                        "companyHomePage", required());
                
CompoundPropertyConstraint compund = new CompoundPropertyConstraint(new Or(companyHomePage,companyAddress));
                 
add(compund);
Besides,I try RequiredIfOthersPresent like this:
Code:
add(new RequiredIfOthersPresent("companyAddress","companyHomePage"));
It does not work as the doc says. anything wrong with my way to use?

Regards

Luciss Li