Page 1 of 1

How to add add validation in AdminPresentationCollection?

Posted: Wed Oct 15, 2014 8:10 am
by hardikraval
How we can add validation in @AdminPresentationCollection similar to what we can do with @AdminPresentation.

validationConfigurations is not allowed as part of @AdminPresentationCollection

Code: Select all

validationConfigurations={
                    @ValidationConfiguration(validationImplementation="parentMerchantValidator",
                            configurationItems={
                                    @ConfigurationItem(itemName=ConfigurationItem.ERROR_MESSAGE, itemValue="Parent can not be a parent or child of other merchant")
                            })
            })


Please find the attached screenshots for more details.

We want to add validation when user selects some item from the pop up which is opened while pressing 'Add' button as shown in screenshot '2.png'. Pop up is shown in '3.png'.

SO how can we achieve this?

Thanks & Regards,
Hardik Raval

Re: How to add add validation in AdminPresentationCollection?

Posted: Wed Oct 15, 2014 2:54 pm
by phillipuniverse
This is not something that we currently support in a 'nice' way like we do with @AdminPresentation. Pull requests welcome!

The way you could get around this is by adding a PersistenceEventPreHandler to look at the PersistencePackage that comes in as a result of adding to the collection.