selectBooleanCheckbox checked

Components, Ajax Framework, Utilities and More.
Post Reply
Gantz
Posts: 9
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: 8586
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
Ronald van Kuijk
______________________________
PrimeFaces 5.2, PrimeFaces plus 0.0.2 | JbossWildfly 8.1| Mojarra 2.2.8
Fedora 21, Firefox 'most recent'
Read the forum posting rules
Beginners: https://jsf.zeef.com/bauke.scholtz

Gantz
Posts: 9
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: 3206
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

13 Sep 2017, 22:23

"value" requires a ValueExpression (property + getter/setter)
Always Bet On Prime (+ Extensions)!

Thomas Andraschko
PrimeFaces Developer | PrimeFaces Extensions Founder
Apache OpenWebBeans PMC | Apache DeltaSpike PMC | Apache MyFaces PMC

Personal Blog: http://tandraschko.blogspot.de/

kukeltje
Expert Member
Posts: 8586
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
Ronald van Kuijk
______________________________
PrimeFaces 5.2, PrimeFaces plus 0.0.2 | JbossWildfly 8.1| Mojarra 2.2.8
Fedora 21, Firefox 'most recent'
Read the forum posting rules
Beginners: https://jsf.zeef.com/bauke.scholtz

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider] and 15 guests