• 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

Mixing JSF and jstl

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please Help.

I'm trying to build a page with JSF and use a datatable to display information. One the columns (called category) is a requestLink to another page. Depending on the String value of category determines whether it is a link or not.

I'm trying to use the JSTL core if statements to print the link or just the text, but it seems like the core code only exectues once. Any suggestions?




varbottomLineExpandedSummary is the backingBean that is used to generate the datatable. Any suggestions or pushes in the right direction would be greatly appreciated!
 
Saloon Keeper
Posts: 27807
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
JSTL and JSF don't mix all that well. A cleaner approach is to define the item as both an output text and a link text and use the "rendered" attribute to select which one to display.

Of course, since "rendered" normally accesses a property on the backing bean, this has the side effect of encouraging you not to put logic on the View, and therefore nudges you more towards a true MVC approach than JSTL would.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic