Page 1 of 1

Lookup filter on sku grid list

Posted: Fri Aug 14, 2015 6:08 am
by tonystt
Hi all,

We are developing custom module on Broadleaf GA3.1.12
That module support admin to select sku items from the grid list insded the enityform.
Those items should be filtered based on some our rule.
We follow tutorial at http://www.broadleafcommerce.com/docs/c ... list-grids to develop a custom persistence handler which its override canHandleFetch as below

@Override
public Boolean canHandleFetch(PersistencePackage persistencePackage) {
String ceilingEntityFullyQualifiedClassname = persistencePackage.getCeilingEntityFullyQualifiedClassname();
try {
Class testClass = Class.forName(ceilingEntityFullyQualifiedClassname);
return Sku.class.isAssignableFrom(testClass);
} catch (ClassNotFoundException e) {
return false;
}
}

But it seems to be the framework does not call that method in case we press the lookup to show up the sku gird list.

Please help us to solve it out.

Thanks,
Tony

Re: Lookup filter on sku grid list

Posted: Sun Aug 16, 2015 11:10 pm
by tonystt
I know the reason, There is another handler of Sku too.
So that handler makes PersistenceManagerImpl returns the execution in the loop of fetch before calling my handler.
So my question now is how to have more than one handler on the same entity?
Can I implement PersistenceManagerEventHandler to override the response data

Re: Lookup filter on sku grid list

Posted: Mon Sep 14, 2015 7:26 pm
by phillipuniverse
Yes, you can write a custom PersistenceManagerEventHandler postFetch to override anything from the rest of the persistence pipeline.