Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • criteriaModifierName - arbitrary name of modifier method
  • searchCriteriaBuilder - criteria builder used by component

There is also second version of criteria modifier method that you can define:

Code Block
themeEclipse
languagejava
linenumberstrue
public void criteriaModifierName(final SearchCriteriaBuilder searchCriteriaBuilder, final FilterValueHolder filterValueHolder ) {

        // CRITERIA MODIFIER BODY
}

Where

  • criteriaModifierName - arbitrary name of modifier method
  • searchCriteriaBuilder - criteria builder used by component
  • filterValueHolder - criteria value passed from before render hook. 

To set FilterValueHolder you have to get it from LookupComponent in before render hook, modify it and set id again

Code Block
themeEclipse
languagejava
linenumberstrue
public void beforeRenderHook(final ViewDefinitionState viewDefinitionState) {
	LookupComponent lookup= (LookupComponent) viewDefinitionState.getComponentByReference("lookupReference");
	FilterValueHolder holder = lookup.getFilterValue();
	holder.put("key", "value");
	lookup.setFilterValue(holder);
}

To see how to bind modifier method with view component go to 'criteria modifiers' in 'Hook an Listeners' section.

...