• Post Reply Bookmark Topic Watch Topic
  • New Topic

Render problems and selectonemenu  RSS feed

 
Camilo Contreras
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey hello everyone im new here :D, i have a problem with jsf render options :( .

I have this example code. i need when i choose for example "two" it should appear "myDiv" but only when i choose "two".

i need to make this in the listener because this its an example, i know that i can do this in the same h:panelGroup as "<h:panelGroup id="mydiv" rendered="#{bean.selected == 'two'}">

Here its my code, now this didnt work, it doenst show my div when i pick "two"



and this is my method in the bean



so many thanks btw! , cheers
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Camilo!

I have doubts about this element:



Are you attempting to make the selectOneMenu value be null when this item is selected? Because null is a binary value and HTML is a text protocol. Since JSF renders to HTML and receives HTML, there's no way to handle binary values.

My version of a "must-select" control looks more like this:



This version does require that an empty string be an invalid choice for actual data (we are requiring the user to make a valid choice).

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!