my dog learned polymorphism*
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "jQuery find h:selectOneMenu component" Watch "jQuery find h:selectOneMenu component" New topic
Author

jQuery find h:selectOneMenu component

Joe Shannow
Ranch Hand

Joined: Dec 01, 2010
Posts: 35
Hello,

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
Bartender

Joined: Apr 06, 2010
Posts: 4425
    
    8

Duplicate of http://www.coderanch.com/t/537007/JSF/java/jQuery-find-selectOneMenu-component

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: 15299
    
    6

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
Marshal

Joined: Jan 10, 2002
Posts: 61449
    
  67

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jQuery find h:selectOneMenu component