问题
I have a form with <p:inputText> and <p:selectOneMenu> components next to each other. When the focus is on the input text and I press the tab key in order to navigate to select one menu by keyboard, then the focus is lost. I don't see which component is focused.
How can I get the focus on the select one menu when I tab into it?
回答1:
You need to use the tabindex property of <p:inputText> and <p:selectOneMenu>, as explained in the documentation.
回答2:
Using the tabindex property makes it possible to navigate between <p:inputText> and <p:selectOneMenu>. What worked for me was to see set the tabindex in <p:inputText> to n and n+1 in <p:selectOneMenu>. I used n = 90.
来源:https://stackoverflow.com/questions/19033979/pselectonemenu-doesnt-receive-focus-on-tab-key-navigation