How to render an element whose id is automatically generated in JSF?

微笑、不失礼 提交于 2019-12-25 05:12:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!