下午好,
我有一个搜索页面,它使用 ajax 来呈现几个数据表而不刷新页面。我必须为每个表调用一个方法作为侦听器。下面是第一个工作正常的数据表的片段。
要呈现第二个数据表,我需要调用一个方法#{evalController.prepareList}
作为 ajax 的侦听器。问题是<f:ajax
“Listener”属性不会采用一种以上的方法。
所以剩下的方法就是调用<f:ajax
几次,每次都用不同的监听器,这是行不通的。有没有办法做到这一点?如果不是,我是否应该在托管 Bean 中创建一个方法来调用我需要的所有方法并将其用作一个侦听器?
在此先感谢您的帮助。
<h:form id="searchform">
<h:panelGrid columns="3" >
<p:inputText value="#{ddnController.patientID}" id="pidinput" maxlength="7" size="7">
<f:ajax execute="@this" event="keyup" render="searchbutton ddntable" listener="#{ddnController.prepareList}"/>
</p:inputText>
<h:commandButton image="#{resource['images/search.png']}" id="searchbutton" value="#{bundle.Search}"
action="submit" actionListener="#{ddnController.prepareList}"
disabled="#{empty ddnController.patientID or ddnController.patientID.equals('0')}"/>
<p:panel><h:outputText value="Saisir 0 pour avoir tous les Patients" style="font-style: italic;"/></p:panel>
</h:panelGrid>
<p:dataTable id="ddntable" value="#{ddnController.items}" var="ddn" rendered="#{!empty ddnController.items}" paginator="true" >....