Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Datatable if  RSS feed

 
Miclea Paul Alexandru
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys, i'm new here on JavaRanch. I struggling with something in JSF. Let's take this code for example:


Let's say i want to test if customer.id equals 50. If so, instead of writing his id in the datatable i would write "Golden Customer" or something, else i would write "Normal Customer". Any idea how to do this? I have tried it like this.

For whatever reason the condition is never validated. Any thoughts?
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you could try something like this:



And in your backing bean

 
Miclea Paul Alexandru
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well this won't work, "customer" is not a bean, it's generated when the table is created. Also if i try to set the property of a bean to the value of a field in "customer" for example "customer.id" it won't work... i think i am missing something here...
 
Miclea Paul Alexandru
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got it, this was actually easier than i thought .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!