如何通过更新

时间:2012-08-14 03:23:13

标签: jsf jsf-2

我无法使用globalFilter数据更新输入文本。

我可以在bean中看到globalFilter值,并且我还使用Firebug检查我使用了正确的id,但播放值仍为空。

<p:dataTable id="osTable"       
                 var="object" 
                 value="#{bean.lazyModel}" 
                 selection="#{bean.selectedObject}" 
                 selectionMode="single"
                 rowKey="#{object.ID}"
                 paginator="true"
                 paginatorPosition="bottom"
                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                 rowsPerPageTemplate="5,10,15"
                 rows="10"
                 widgetVar="tableWidgetVar">
        <p:ajax event="filter" listener="#{bean.onFilter}" update="osTable:play"/>
        <f:facet name="header">  
            <p:outputPanel id="panel" style="float: left">
                <h:panelGrid columns="3">
                    <p:inputText id="globalFilter" onkeypress="if (event.keyCode == 13) {tableWidgetVar.filter()}" style="width: 100px"/>
                    <p:commandButton value="Clear Filter" ajax="true" action="#{bean.update}" onclick="document.getElementById('osTable:globalFilter').value = ''"/>
                </h:panelGrid>
            </p:outputPanel>  
            <h:inputText id="play" value="#{bean.filter}"/>
        </f:facet> 

知道为什么吗?

由于

0 个答案:

没有答案