Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Problem with <h:selectonemenu>...  RSS feed

 
vijay k vemula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

First of all i would like to thankyou all for your previous valuable suggestions. I got stucked up with a problem.
I have a dropdown list in which i have only 2 values 'Remodeling' and 'New'. When the user selects the option 'Remodeling' , i need to render a group of checkboxes.I tried lot many ways but didn't work.

Could anyone please help me out on this. Below is my sample code:

Code to display drop down list

--------------------------------------------------------------------------------
<h:selectOneMenu value="#{gfmCoverageABean.constructionType}" valueChangeListener="#gfmCoverageABean.onConstructionTypeChange}">

<f:selectItems id="typeOfConstructionProject" value="#{gfmCoverageABean.typeOfConstructionProjectList}" />

</h:selectOneMenu>

Code to render checkbox when drop down option selected is 'Remodeling'

--------------------------------------------------------------------------------
<h:outputLabel id="foundationLbl" for="foundation" value="#{PolicyLabels['GfmCoverageADetails.Foundation']}"
rendered="#{gfmCoverageABean.constructionType eq 'Remodeling'}"/>
<ig:checkBox id="foundation" value="#{gfmCoverageABean.gfmCoverageView.foundation}"
rendered="#{gfmCoverageABean.constructionType eq 'Remodeling'}"/>

Problem here is my checkbox is not getting displayed on any case.

Thanks
vijay
 
Bauke Scholtz
Ranch Hand
Posts: 2458
 
Kumaresh Vidhyasagar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is with this below code I guess:
rendered="#{gfmCoverageABean.constructionType eq 'Remodeling'}"

When you select a option from that menu, it does not return this value. It may be returning 'key' value of the SelectItems

typeOfConstructionProjectList

Please tell me how you are populating the List above.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!