问题
I have primefaces'datatable placed on primefaces tabView..
I m using filtering on it. As new values are updated in the grid, I want to re-render the filters.
The filter id is generated as: tabViewId:ActiveTabIndex:DatatableID:ColumnName_filter.
On value change of input text, I want to re-render the filter.
<p:column width="40">
<h:inputText id="vendorInputTxt" value="#{articlePromo.proveedor}"
styleClass="inputTextStyle">
<f:ajax event="change" render=":categoryTabView:0:promotionDetail_dataTable:vendorColumnHeader_filter"
listener="#{promotionDetailManagedBean.onProveedorChange}" />
</h:inputText>
</p:column>
But it gives the error, contains an unknown id ':categoryTabView:0:promotionDetail_dataTable:vendorColumnHeader_filter' - cannot locate it in the context of the component vendorInputTxt
What is the right way to render the filter again?
Thanks, Shikha
回答1:
try a js call oncomplete to: widget_<dataTableId>.filter();
where the dataTableId is the id given to the dataTable.
来源:https://stackoverflow.com/questions/10119518/how-to-render-an-element-whose-id-is-automatically-generated-in-jsf