The moose likes JSF and the fly likes jQuery find h:selectOneMenu component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "jQuery find h:selectOneMenu component" Watch "jQuery find h:selectOneMenu component" New topic

jQuery find h:selectOneMenu component

Joe Shannow
Ranch Hand

Joined: Dec 01, 2010
Posts: 35

how can I find the JSF <h:selectOneMenu> component using by jquery methods?
I can find <h:inputText styleClass="input"> only:
Any advice? Thank you
Matthew Brown

Joined: Apr 06, 2010
Posts: 4543

Duplicate of

Joe, can you avoid posting the same message more than once? Thanks. Just pick what you think is the most appropriate forum and stick with it. Otherwise we might get people trying to help you out duplicating work that's already been done.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

I'm unlocking this as it is the more appropriate forum for this question. And I am locking the JSF thread. And yes, please do NOT post the same question more than once.

There is more than one way:

Also, JSF should give all your element an ID that you could use to find it. You might just need to inspect the source. I know that JSF prefixes ID's with junk. Just don't remember what that junk is. Also, you could simply give your SELECT element a class, and reference it that way.

GenRocket - Experts at Building Test Data
Joe Shannow
Ranch Hand

Joined: Dec 01, 2010
Posts: 35
Sorry, I wasn't sure where to put it, thanks

I've tried but it doesn't work.

I've add those components styleClass="input"
but my jQuery method to redirect ENTER to TAB key doesn't focus to selectOneMenu (when it step on it) and instead of focus it submits the button

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

I'm going to respectfully disagree with Gregg and move this to the JSF forum. Examples with JSF markup will only makes sense to the JSF-savvy and to no one else.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: jQuery find h:selectOneMenu component
It's not a secret anymore!