-
1. Re: How Do I Set focus on an inputText field after an onkeyup event?
liuliu Sep 30, 2010 3:15 AM (in response to jabailo)hi
do you try focus attribute on a4j:support? and think about requestdelay too.
liu
-
2. Re: How Do I Set focus on an inputText field after an onkeyup event?
jabailo Sep 30, 2010 2:28 PM (in response to liuliu)When I set the focus, it highlights the whole entry in inputText.
Is there a way to have it set focus, but put the cursor at the end of the entered text?
-
3. Re: How Do I Set focus on an inputText field after an onkeyup event?
liuliu Oct 1, 2010 3:41 AM (in response to jabailo)hi,
I did a test, I do not have your problem,do you rerender you inputtext too? could you show your code?
liu
-
4. How Do I Set focus on an inputText field after an onkeyup event?
dominic89 May 3, 2011 3:19 AM (in response to liuliu)Hi, I have the same Problem, here ist my code:
<s:decorate id="test" template="/layout/edit.xhtml">
<h:inputText id="searchAuthor" value="#{hoerbuchDBHome.searchString}">
<a:support event="onkeyup" reRender="searchAuthor,authorShuttle" ajaxSingle="true" requestDelay="250" />
</h:inputText>
<ui:define name="label">Authors</ui:define>
<rich:listShuttle id="authorShuttle"
sourceValue="#{hoerbuchDBHome.availableAuthorList}"
var="_itemsA" targetValue="#{hoerbuchDBHome.selectedAuthorList}"
fastOrderControlsVisible="false">
<rich:column>
<h:outputText value="#{_itemsA.name}" />
</rich:column>
<s:convertEntity />
</rich:listShuttle>
</s:decorate>
I have to redender the textfield to get the input in my bean.
Is there a solution to fix this ?
-
5. How Do I Set focus on an inputText field after an onkeyup event?
ilya_shaikovsky May 4, 2011 10:53 AM (in response to jabailo)you could use focus attribute of support as suggested. But yep it has a problem with setting text selected after focused. so as a workaround you could use http://livedemo.exadel.com/richfaces-demo/richfaces/filteringFeature.jsf?tab=ex-usage&cid=223489 instead. (see source and setCarretToEnd js usage.)
-
6. How Do I Set focus on an inputText field after an onkeyup event?
jabailo May 4, 2011 12:52 PM (in response to dominic89)I used a requestDelay of 1000
<h:inputText id="acctnumFilter"
value="#{ADAMDataModel.acctnum_FilterValue}" >
<a4j:support
event="onkeyup"
focus="acctnumFilter"
reRender="adamUsers"
requestDelay="1000"/>
</h:inputText>
Where I adamUsers is the rich:dataTable
And it worked fine
-
7. How Do I Set focus on an inputText field after an onkeyup event?
dominic89 May 5, 2011 1:58 AM (in response to jabailo)Hey I am sorry but for the next month I am in an other Department. So I could try your solution not now. But I give you feedback if I could try it.
The solution from Ilya looks fine and I would try it first. Because with the focus element the whole text in textfield is choosen and that's not the way I need.