This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes focus is not going to h:selectonemenu on pressing tab key 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 "focus is not going to h:selectonemenu on pressing tab key" Watch "focus is not going to h:selectonemenu on pressing tab key" New topic
Author

focus is not going to h:selectonemenu on pressing tab key

Nishant Chauhan
Greenhorn

Joined: May 31, 2012
Posts: 5
Hi

I am working on jsf 1.2 and IE6. Actually when I tab through the screen and clicks on some component like textfield, calendar etc then tab is not going to the drop downs. If I select any components in the screen then tab order is lost for h:selectOneMenu drop down. Please help me to fix this issue. Thanks in advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15958
    
  19

Nishant Chauhan wrote:Hi

I am working on jsf 1.2 and IE6.




Welcome to the JavaRanch, Nishant!

The core JSF "h" tags all have raw HTML equivalent controls that they generate and the tab support is the same.

I think you may be expecting a dropdown list to automatically display when you tab to the dropdown control, but in most browsers it doesn't do that - you have to press the Down Arrow key after tabbing to it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Nishant Chauhan
Greenhorn

Joined: May 31, 2012
Posts: 5
Hi Tim & all my friends

Thanks Tim for your response to my first post in this forum. Actually my query is different. Ok let me explain it again. lets assume we have following components in the screen-

textfield (tabindex 1)
calander (tabindex 2)
drop down (tabindex 3)
button (tabindex 4)

Now if we navigate to the screen and start pressing tab key then tab focus is going to each component according to the tabindex, means first tab focus will go to the textfield then calander then drop down then button. In this case tabbing is working fine.

But if i enter some text in the textfield and press tab key then focus is going to the next calander component as expected but if i press tab again then it is skipping the drop down (h:selectOneMenu) and focus is going to the button and if again i press tab then focus is going to the drop down.

Same problem is happening if i select date in the calander also.

Finally the thing i am not getting here the tab order is lost for drop down only if any component is clicked in the screen.
Nishant Chauhan
Greenhorn

Joined: May 31, 2012
Posts: 5
Hi all

As I mentioned earlier that tab key is skipping drop downs if I select date or enter some text in the text field,what I found here is if I re-render the drop downs on date selection or on enter text in textfield then focus is going to the drop downs according to the tabindex. But why focus is Going to dropdown if we re-render it. I checked tabindex in the view source code before and after re-rendering drop down and its showing same tabindex as what we hard coded in the jsp page. Now my question is if tabindex is same before and after re-rendering drop downs then why tabindex is working after re-rendering drop down.

Please help me. It's urgent.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15958
    
  19

I'm afraid that "urgent" isn't something that works well here at the Ranch - http://www.coderanch.com/how-to/java/PatienceIsAVirtue

There's not much help I myself can give anyway. I don't even run Windows myself, and when I do have to work with a Windows machine, they've all been upgraded to IE8 or later. Overall, I'd say that it should be far, far more urgent to get off of IE6 than to worry about tabbing. Even Microsoft doesn't love IE6 any more.

When you do an full or partial re-render of a page, the current tab position is likely to be lost. And when you have selected a text-editing control, the tab may not work while that control is accepting keystrokes for input text. That's about all I can tell you.
Nishant Chauhan
Greenhorn

Joined: May 31, 2012
Posts: 5
Thanks for responding again TIM.

As you mentioned that tabindex will be lost after partially or fully re-rendering the page, I am agree but For your information I am doing a4j support ajax calls for each component and retaining/setting focus back to the component after the call. So focus will not be lost.

Anther thing IE 6 that is application requirement. I do not have options.

So now my question again why focus is going to the re-rendered drop down. Is this a bug.
Nishant Chauhan
Greenhorn

Joined: May 31, 2012
Posts: 5
Dear friends

I still did not find any solution. Now this issue became a known issue of my application. Is there any trick to fix this issue. Have anyone faced this issue earlier. All suggestions are welcome.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: focus is not going to h:selectonemenu on pressing tab key
 
Similar Threads
selected value through select items
Rearrange Tabs via Drag and Drop
Getting java.lang.NullPointerException error with (SelectONE)
<h:selectOneMenu>— display an option in different color
Need a very simple menu system, but stuck....