selectBooleanCheckbox checked

UI Components for JSF
Post Reply
Gantz
Posts: 10
Joined: 20 Feb 2017, 20:09

12 Sep 2017, 19:27

hi im using a table with a selectBooleanCheckbox column, i have to indicate if a item is already saved in the database and i want to show the selectBooleanCheckbox cheked but the only way i found to do it is this

Code: Select all

<p:selectBooleanCheckbox value="#{unidadesController.asignadosFromDB.contains(item) ? true:false}">
but when i try to perform an ajax action gives this error

Code: Select all

value="#{unidadesController.asignadosFromDB.contains(item) ? true:false}": Illegal Syntax for Set Operation
theres another way to show the selectBooleanCheckbox cheked ??? or a way to solve this error?
thanks!

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

12 Sep 2017, 21:17

Tried making it readonly or disabled? Since you can never manipulate it

Gantz
Posts: 10
Joined: 20 Feb 2017, 20:09

13 Sep 2017, 17:02

i cant put it disabled because i do manipulate the checkbox, when the user selects the checkbox it performs an ajax action

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

13 Sep 2017, 22:23

"value" requires a ValueExpression (property + getter/setter)
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

14 Sep 2017, 15:54

Hmmm if you do manipulate it, it is strange that you expect a conditional expression would work. Thomas is right then... Use a pure value expression then

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests