Ich habe eine rich:extendedDataTable
und ich verwende Spaltenfilterung. Ich möchte, dass der Filter ausgelöst wird, sobald der Benutzer die "Intro" -Taste eingibt, aber in Javascript gibt es kein solches Ereignis.Richfaces Spalte Filter: Wie feuere ich ein Ereignis auf Intro-Taste
Ich möchte dies tun, denn wenn ich Ereignisse wie onkeyup
verwende, bekomme ich zu viele Anfragen und ich habe Probleme deswegen. Ich benutze richfaces 3.3.0GA und Facelets.
Dies ist die Komponente:
<ui:composition>
<a4j:form ajaxSingle="true" requestDelay="700">
<rich:extendedDataTable id="tablePatients" value="#{user.patientsTab.patients}" var="patient" rows="20"
onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
<f:facet name="header">
<h:outputText value="Patient List" />
</f:facet>
<rich:column label="#{msg.id}">
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<h:outputText value="#{patient.id}" id="patientId" />
</rich:column>
<rich:column label="#{msg.name}" sortable="true" filterBy="#{patient.profile.name}" filterEvent="onkeyup">
<f:facet name="header">
<h:outputText value="Name" />
</f:facet>
<h:outputText value="#{patient.profile.name}" id="name" style="#{patient.isUnrated? 'font-weight:bold':''}" />
</rich:column >
<rich:column label="#{msg.lastexamination}" sortable="true">
<f:facet name="header">
<h:outputText value="Last Examination" />
</f:facet>
<h:outputText value="#{patient.lastExaminationDate}" style="#{patient.isUnrated? 'font-weight:bold':''}" />
</rich:column>
<rich:column label="#{msg.action}">
<f:facet name="header">
<h:outputText value="#{msg.action}"></h:outputText></f:facet>
<a4j:commandLink id="editlink" oncomplete="#{rich:component('patientPanel')}.show()" reRender="a4jPatientPanel">
<h:graphicImage value="/images/icons/PNG-24/Add.png" style="border:0" />
<f:setPropertyActionListener value="#{patient}" target="#{user.patientsTab.patientPanel.patient}" />
</a4j:commandLink>
<rich:toolTip for="editlink" value="Edit" />
</rich:column>
<f:facet name="footer">
<rich:datascroller renderIfSinglePage="false" maxPages="5" />
</f:facet>
</rich:extendedDataTable>
</a4j:form>
<ui:include src="/pages/panels/patientPanel.xhtml" />
</ui:composition>
Mmmm Ich habe es versucht und es funktioniert nicht. Ich drücke Enter und nichts passiert. Wenn ich außerhalb des Eingabefeldes (onblur) klicke, filtert es. Ich habe versucht mit ExtendedDataTable und mit DataTable. Gleiches Ergebnis. – pakore
Gibt es eine Möglichkeit, die Anfrage zu verzögern? anscheinend "requestDelay" in "a4j: form" verzögert nicht ... Danke für die Antwort obwohl. – pakore
nicht out-of-the-box. Aber es könnte ein Workaround geben. Ich denke drüber nach. – Bozho