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 How to get selectOneMenu value 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 "How to get selectOneMenu value" Watch "How to get selectOneMenu value" New topic
Author

How to get selectOneMenu value

Sami M�nnist�
Greenhorn

Joined: Sep 18, 2006
Posts: 9
Hi!
I need to get selectOneMenus selected value when page loads.
I only need it for the first time when page loads so the value is the first one in the list...But how to access it?

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Do you want to access it by JavaScript or JSF?
Sami M�nnist�
Greenhorn

Joined: Sep 18, 2006
Posts: 9
Id rather access it by jsf but in the end either will do.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Well, the selectOneMenu value is accessible by endpoint.protocol.

If you don't understand how it works, here is a basic working example:

JSF

MyBean
Sami M�nnist�
Greenhorn

Joined: Sep 18, 2006
Posts: 9
Thanks Bauke but the problem is that endpoint.protocol is an entity witch gets its values from database and when the user presses new endpoint on previous page new record is created and endpoit.protocol is null. I need to get the default value of selectOneMenu so I can disable certain fields.
That needs to be done only once when page loads after that javascript takes care of that when selectOneMenu changes...

Sorry for my bad presentation on my first question.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get selectOneMenu value
 
Similar Threads
Error with jsp and JavaBeans
Issue With selectOneMenu ValueChangeListener Not Firing
404 Error
[Problem]_layout of include page
Object id not getting