wood burning stoves 2.0*
The moose likes JSF and the fly likes how to make selectOneMenu as display field? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "how to make selectOneMenu as display field?" Watch "how to make selectOneMenu as display field?" New topic
Author

how to make selectOneMenu as display field?

yamini nadella
Ranch Hand

Joined: Apr 13, 2004
Posts: 257
I have two pages. in main page user selects SelectOneMenu and x:inputCalendar date. From there he goes to second page. In second page also I am showing these two components. But I dont want user to change them.

Is there any way to only display them instead of changing?

Thanks in advance,
Yamini
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by yamini nadella:
I have two pages. in main page user selects SelectOneMenu and x:inputCalendar date. From there he goes to second page. In second page also I am showing these two components. But I dont want user to change them.

Is there any way to only display them instead of changing?


Write the value on the page, use hidden fields to carry the ID. Or just make the component readonly.

Moreover, JSF takes readonly as disabled. Thus, it may not work. If you want to do this then you need to extend the SelectOneMenu and modify as you like.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

The key is to use appropriate components for appropriate behavior. If you just need to display a static choice someone made from a dropdown then it seems to me using a selectOneMenu component isn't the right choice. Why not just use an outputLabel or outputText component to display the value from the backing bean?


GenRocket - Experts at Building Test Data
 
 
subject: how to make selectOneMenu as display field?
 
Similar Threads
Issue With selectOneMenu ValueChangeListener Not Firing
I need help with ajaxSingle, reRender and immediate.
How to render and update a “form” within a condition using primefaces
Multiple selectOneMenu with same value
Problem with selectOneMenu