• 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

<c:if vs rendered attribute

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was using rendered attribute in one of the inputText tags like


i noticed that the getter for permission property gets invoked about 4 times, so i used c:if instead


With this the getter of permission property gets invoked only once.

Based on this, should i conclude that using c:if is a better alternative than rendered attribute? Or are there situations where using rendered attribute for displaying/hiding controls would be more useful
 
Saloon Keeper
Posts: 27752
196
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
If you use JSTL, JSF won't be properly aware of what you're doing to the View structure.

Also, there's a reason why the setter gets called multiple times, so there's a strong possibility that you're short-circuiting parts of the JSF lifecycle on that control.
 
reply
    Bookmark Topic Watch Topic
  • New Topic