• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

h: panelGroup issue

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to display a button in jsf page based on a condition.

Backing Bean
-----------------


JSF
------


The second button is displaying only whatever (true/false) returned from the backing bean.

Can anyone help me to solve this.
 
Saloon Keeper
Posts: 24809
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You indicated that the "rendered" attribute should reference a bean named "showButton". What you probably meant was:


However, since that requires a boolean bean property, your actual bean method should be named "isShowButton()".
 
Maya Pillai
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made the change .....still only the second option is working always....whatever value (true/false) in the isNOKFilled variable.

 
Tim Holloway
Saloon Keeper
Posts: 24809
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not how JavaBeans work. To get your view to function as expected, you'd need to add a method named "isIsNOKFilled" to your backing bean.

The "set" and "get/is" part of the accesor method name is automatically added when the EL processor evaluates the expression. You should not supply it yourself.

In JSF, if a property is not found, it is usually treated as being null and is ignored. So if you misspell a property or action name, you won't see any errors, they just won't work right.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic