[
https://issues.jboss.org/browse/RF-3632?page=com.atlassian.jira.plugin.sy...
]
Júlio Adrian Miño Van Helden commented on RF-3632:
--------------------------------------------------
Hellow Benno, i am newbie in JBoss comunity.
Benno, i am facing the same problem that you reported above (in June 2008).
I mean, If i use the <a4j:support event="onkeyup" focus="thisInput"
reRender="otherInput, thisInput">, after de Ajax reRendering, the whole text
in "thisInput" is selected. The problem is, when the user press another
keyboard key, he looses the previous text. I need, before Ajax response, that the focus
remains in "thisInput" field, but without selecting the whole text. I tried
several approaches, without using the focus attribute and trying to put the focus using
JQuery, but it seems the DOM refresh (reRendering) occurs before or in the same time the
Ajax response. Is there a workaround for this ? Using JQuery, JSF 2.0, Richfaces 3.3.3...
The strategie doesn't matter, i would like to solve this issue in my application. Best
Regards.
Lost input focus after rerendering parent form
----------------------------------------------
Key: RF-3632
URL:
https://issues.jboss.org/browse/RF-3632
Project: RichFaces
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 3.2.1
Environment: RF 3.2.1.CR3
IE 6
Firefox 2.0.0.11
Java 1.5.0_15
jetty-6.1.9
WinXP SP2
Reporter: Benno Markiewicz
Assignee: Alexander Dubovsky
A control within a parent form looses its focus when the parent form is rerendered. The
rerendering was forced by an event fired from the child control. See the source (based on
http://livedemo.exadel.com/richfaces-demo/richfaces/support.jsf?c=support)
<h:form id="myform">
<h:panelGrid columns="2">
<h:inputText id="myinput"
value="#{userBean.name}">
<a4j:support event="onkeyup" reRender="myform"
/>
</h:inputText>
<h:outputText id="outtext" value="#{userBean.name}"
/>
</h:panelGrid>
</h:form>
Notice the difference. Instead of "outtext" "myform" will be
rerendered.
Background: You have a detail form with several components. Every control on the form
changes the internal state. The view represents the actual state, so the whole form has to
be rerendered. But when you rerender the parent form, the focus/selection state of the
actual component is lost.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira