This content has been marked as final.
Show 5 replies
-
1. Re: Setting focus to an element which is rerendered
ilya_shaikovsky Sep 1, 2009 6:06 AM (in response to orik)RF version?
-
2. Re: Setting focus to an element which is rerendered
orik Sep 1, 2009 9:33 AM (in response to orik)Using 3.3.1 GA.
-
3. Re: Setting focus to an element which is rerendered
ilya_shaikovsky Sep 2, 2009 6:05 AM (in response to orik)works ok for me at 3.3.2 snapshot. try 3.3.2 CR1.
-
4. Re: Setting focus to an element which is rerendered
orik Sep 2, 2009 12:23 PM (in response to orik)With h:inputText it does works fine,
I'm getting this problem when trying to set the focus to a rich:combobox, and the target combobox is located after the current element in the tree.
If the combobox target element is before the element initiating the request there is no problem.
In my case:<h:panelGrid columns="3" id="criteriaGrid" width="100%"> <h:panelGroup id="columnPanelGroup"> <rich:comboBox id="selectedColumCombobox" value="#{bean.selectedColumn}" suggestionValues="#{bean.selectedColumnsList}"> <a4j:support id="columnValidator" reRender="criteriaGrid" event="onblur" actionListener="#{bean.validateSelectedColumn}" focus="test"/> </rich:comboBox> </h:panelGroup> <h:panelGroup id="testPanelGroup"> <rich:comboBox id="test" value="#{bean.selectedColumn}" suggestionValues="#{bean.selectedColumnsList}" /> </h:panelGroup> </h:panelGrid>
From checking the log output i can see that the focus is set to the test element BEFORE the test element script is evaluated.
Can it be that evaluating the script causes the element to loose focus?
Verified this on both 3.3.1 and 3.3.2 CR1.
Log:
debug[12:15:14,708]: call getElementById for id= _A4J.AJAX.focus
debug[12:15:14,709]: focus must be set to control
...:test
debug[12:15:14,709]: Set focus to control
...
debug[12:15:14,751]: Evaluate script replaced area in document: // new Richfaces.ComboBox("...:test",{'listOptions':{'itemsText':['Txn ID','Link Status','Action','Id','Origin Ticket ID','Master ID','Lifecycle Status','Matching Status','Approval Status','Allocation....