File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » JSF
Bookmark "Losing Tab Index Order After Ajax Request" Watch "Losing Tab Index Order After Ajax Request" New topic
Author

Losing Tab Index Order After Ajax Request

Umut Arisoy
Greenhorn

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.

Umut

P.S. Here is the code,
<r:comboBox id="markaInput"
value="#{birlesikKaskoPrimHesapHome.marka2}">
<a:support ajaxSingle="true" event="onselect"
eventsQueue="selectQueue"
similarityGroupingId="selectGroup"
action="#{birlesikKaskoPrimHesapHome.markaSecildi()}"
reRender="STUFF" />
<f:selectItems value="#{birlesikKaskoPrimHesapHome.markaList2}" />
</r:comboBox>


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
Greenhorn

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
Umut,

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

 
 
subject: Losing Tab Index Order After Ajax Request