Color my datatable's rows with condition??

UI Components for JSF
kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

24 Jul 2014, 18:08

You can debug a lot, lot more... e.g. is the class actually ADDED to the row? What if you add it statically (no EL)? etc... All basic 'debugging' stuff you can (should) do yourself. We are not here to write full code for you, but Snooperman already almost did...

novice
Posts: 8
Joined: 21 Jul 2014, 18:56

28 Jul 2014, 22:16

I didn't ask you to write code for me! I'm already able to do that I just said when I load the page nothing happened if everything is ok it should work but why it's not the case?

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

29 Jul 2014, 01:09

Read the other part of my post to. You are the only one that can analyze/debug your code. I have comparable code to what snooperman posted that DOES work

User avatar
snooperman
Posts: 155
Joined: 06 Nov 2012, 18:43

29 Jul 2014, 10:35

Novice, what he is trying to say is, you can investigate the problem in the UI also. You can inspect your page and see if the css file is loaded correctly (you can get 404 not found if the path is not correct), also, you can inspect your table rows and see what classes they have ( maybe the css selector is wrong, maybe your article.quantity is null and your EL breaks; if your EL condition breaks, I don't think you`ll get any error). In my post I didn't say it's a 100% working code... I adapted my 100% WORKING code to your problem, so maybe I missed something. Bear in mind, that this is a support forum, and you get guidance here, not fully working code.
var details = {
. . PF.version: "5.0.x",
. . JSF.version: "2.x",
. . Tomcat.version: "8.x"
}

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

29 Jul 2014, 10:57

@snooperman: thanks... typing that from my phone would be waaaay to much (typing it from my desktop to to be honest)

novice
Posts: 8
Joined: 21 Jul 2014, 18:56

29 Jul 2014, 11:06

Thank you Snooperman and kukeltje!!

article.quantity is not null but if everything was right it will certainly work. :D ;)
This is the first time I use css in primefaces. I'm still trying to find what's wrong I'll keep you in touch.

Thanks for the replies :)

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

29 Jul 2014, 11:13

novice wrote:This is the first time I use css in primefaces.
And this is not even Primefaces specific. Using EL this way is very generic.

novice
Posts: 8
Joined: 21 Jul 2014, 18:56

29 Jul 2014, 22:05

kukeltje wrote: And this is not even Primefaces specific. Using EL this way is very generic.
I didn't understand. what do you mean by using EL? if there are another way to do what I'm trynna do it will be my pleasure to discover it!!

User avatar
snooperman
Posts: 155
Joined: 06 Nov 2012, 18:43

30 Jul 2014, 09:06

EL = Expression Language, like: "#{(article.quantity le 10 or article.quantity gt 50) ? 'yes': null}". That's why I asked you too look if quantity is null.
var details = {
. . PF.version: "5.0.x",
. . JSF.version: "2.x",
. . Tomcat.version: "8.x"
}

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

30 Jul 2014, 09:22

maybe it is better to read the second link in my signature... Lots of basic jsf stuff there, including terminology like EL etc

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests