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

Mixing JSF and jstl  RSS feed

 
E Paisley
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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!
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!