If you want to hide the view criteria, then here is the easy way
The code is written in the setter of the af:query binding
public void setQuery_binding(RichQuery query_binding) { this.query_binding = query_binding; DCBindingContainer bindings = (DCBindingContainer)this.getBindings(); DCIteratorBinding iter = bindings.findIteratorBinding("<TableIterator>"); ViewObjectImpl voimpl = (ViewObjectImpl)iter.getViewObject(); ViewCriteria vc = voimpl.getViewCriteriaManager().getViewCriteria(""); vc.setProperty(ViewCriteriaHints.CRITERIA_SHOW_IN_LIST, ViewCriteriaHints.CRITERIA_HINT_FALSE); }
- getting the handle to the iterator
- getting handle to the ViewCriteriaManager, and then getting handle to the specific view criteria that we wanted to hide
- modifying the ViewCriteriaHints.CRITERIA_SHOW_IN_LIST property to false
note: helper method – getBindings()
private BindingContainer getBindings() { if (this.bindings == null) { FacesContext fc = FacesContext.getCurrentInstance(); this.bindings = (BindingContainer)fc.getApplication().evaluateExpressionGet(fc, "#{bindings}", BindingContainer.class); } return this.bindings; }
Excellent man … I was wondering how to do this for days … finally its just setProperty method … i knew its hidden in some class. all I was looking for was get a handle to “ShowInList” property somehow. This is awesome.