• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF Problem with <h:selectonemenu>...

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Crossposted: http://forums.sun.com/thread.jspa?threadID=5360535
Please read this: http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites

Why keep you continuing crossposting the topics over all places without notification? You is told before not to do so:
https://coderanch.com/t/422468/JSF/JSF-Tomahawk-File-Upload-Issue
https://coderanch.com/t/422480/JSF/JSF-Tomahawk-File-upload-calculating
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

reply
    Bookmark Topic Watch Topic
  • New Topic