• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make selectOneMenu as display field?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic