Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get selectOneMenu value

 
Sami M�nnist�
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want to access it by JavaScript or JSF?
 
Sami M�nnist�
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Id rather access it by jsf but in the end either will do.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic