Author: andrei_exadel
Date: 2008-09-05 06:57:33 -0400 (Fri, 05 Sep 2008)
New Revision: 10320
Modified:
branches/3.2.x/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml
Log:
RF-4380
Modified:
branches/3.2.x/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml
===================================================================
---
branches/3.2.x/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml 2008-09-05
10:09:20 UTC (rev 10319)
+++
branches/3.2.x/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml 2008-09-05
10:57:33 UTC (rev 10320)
@@ -5,6 +5,24 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+ <script type="text/javascript">
+ function setCaretToEnd (e) {
+ var control = $((e.target ? e.target : e.srcElement).id);
+ if (control.createTextRange) {
+ var range = control.createTextRange();
+ range.collapse(false);
+ range.select();
+ }
+ else if (control.setSelectionRange) {
+ control.focus();
+ var length = control.value.length;
+ control.setSelectionRange(length, length);
+ }
+ control.selectionStart = control.selectionEnd = control.value.length;
+ }
+
+ </script>
+
<h:form>
<rich:dataTable value="#{capitalsBean.capitals}" var="cap"
id="table" rows="20">
<f:facet name="header">
@@ -24,7 +42,9 @@
<f:facet name="header">
<h:inputText value="#{filteringBean.filterValue}"
id="input">
<a4j:support event="onkeyup" reRender="table , ds2"
- ignoreDupResponses="true" requestDelay="700"
focus="input" />
+ ignoreDupResponses="true" requestDelay="700"
+ oncomplete="setCaretToEnd(event);"
+ />
</h:inputText>
</f:facet>
<h:outputText value="#{cap.state}" />