wood burning stoves 2.0*
The moose likes JSF and the fly likes Losing Tab Index Order After Ajax Request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Losing Tab Index Order After Ajax Request" Watch "Losing Tab Index Order After Ajax Request" New topic

Losing Tab Index Order After Ajax Request

Umut Arisoy

Joined: Mar 27, 2009
Posts: 2
Hi Guys,

I've a minor but sticky problem;

After selecting a element from rich:combobox there comes an ajax request and after the "Please Wait" Icon disappear, the current tab index is lost and starts from 1 again.
which completely destroys the user-friendliness of the page.

If you've any idea and if you can help me about this I'll be glad & it'll be very nice for me =)

Thanks for your time.


P.S. Here is the code,
<r:comboBox id="markaInput"
<a:support ajaxSingle="true" event="onselect"
reRender="STUFF" />
<f:selectItems value="#{birlesikKaskoPrimHesapHome.markaList2}" />

money talks, shit walks...
Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177
Hi Umut,

Welcome to Javaranch, you can use the code tags to post your code snippets for better readability.

As for your question does your tab index start from 1? check your reRender value to verify if the
ajax response is going to update the correct components(id's)

I have a dummy example which you can customize for your needs

Umut Arisoy

Joined: Mar 27, 2009
Posts: 2
Hey thanks for the welcome party =D

i'm reRendering just the needed stuff nothing except and not rerendering the big divs, just the id's of the components...
TabIndex starts from 1 but my problem is lets say we are at the 4th combobox which has the tabIndex value is 10; after selecting stg from it and pressing tab the tab order should continue from 11 as usually but in this code it decides to go back to 1...

and cannot use "FOCUS" attribute of Ajax too because the components are disabled, thus focus makes the browser throw a JS Error...

Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177

I just tried the tab index for more than one combo box and it works , you don't require the focus field, I am not sure if you are tracking
a particular user pattern or the normal flow if a user hits tab after selecting a value from the combobox, it should continue the tab order which it does.

here is an addition to my earlier code snippet

I agree. Here's the link: http://aspose.com/file-tools
subject: Losing Tab Index Order After Ajax Request
Similar Threads
RichFaces conditionally rendered tab actions problem
Tab index not working fine for radio buttons
using ajax and struts iterate tags
readyState=4 and Http 404 error in Ajax /Struts
Calling a javascript function after getting ajax response + struts 2.1.6