Datatable : condition the code

UI Components for JSF
Post Reply
denisduval75
Posts: 109
Joined: 08 Nov 2016, 16:53

11 Jan 2018, 13:22

Hello,
In an XHTML page, I want to condition the code with a tag <c: if ...>
I declare a variable with <c: set var = ... /> but it is always empty!
Thanks for your help.

Here is my code:

Code: Select all

<p:dataTable id="idRefContributeur"
      value="#{contributeurManagerBean.colContributeurFacade.listeColContributeur}"
      var="contributeur"
   ...
 
<c:set var="ligneType" value="#{contributeur.type}"/>
 
<c:if test="${ligneType == 'G'}">   <----- Don't work !
   ...
<c:if test="${ligneType == 'L'}">   <-----  Don't work !
   ...

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

11 Jan 2018, 14:15

Just avoid using JSTL, it often doesn't work as expected. There are many threads on stackoverflow about JSTL problems.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

11 Jan 2018, 16:18

And you just **can't** use a datatable var in jstl....

https://stackoverflow.com/questions/344 ... hdatatable

Bladesen
Posts: 1
Joined: 04 Jan 2018, 11:30

12 Jan 2018, 17:00

Having the same issue as Denis. What they best alternative to JSTL, Tandraschko?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests