selectBooleanCheckbox client side API

UI Components for JSF
Post Reply
vtregner
Posts: 3
Joined: 01 Sep 2011, 10:56

12 Dec 2011, 10:03

Hello,
how do I find out if selectBooleanCheckbox is checked in javascript? Which method on widgetVar I should to call? Common jQuery techniques doesn't work to me.
Thanks
Vasek

<p:selectBooleanCheckbox value="#{beStatusBean.autoRefresh}" label="Auto refresh" id="autoRefresh" widgetVar="autoRefresh">
<p:ajax update=":form" process="@form" oncomplete="--here check if checkbox is checked--"/>
</p:selectBooleanCheckbox>

Lyrionus
Posts: 60
Joined: 31 Aug 2011, 09:09

12 Dec 2011, 12:19

What we use is this:

the boolean checkBox:

Code: Select all

<p:selectBooleanCheckbox id="boolInactive" value="true" onchange="javascript:toggleInactive()"/>
javascript:

Code: Select all

			var inactive = true;
			function toggleInactive(){
				inactive = !inactive;
				renderInactive();
			}
JSF 2.0
Primefaces 3.2
Tomcat 7.0

vtregner
Posts: 3
Joined: 01 Sep 2011, 10:56

12 Dec 2011, 14:02

I find out that this works in RC1:

autoRefresh.input.is(':checked')

I vote for adding function isChecked() to client API. Now it contains only check(), uncheck() and toggle()


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: jaircalistrato and 57 guests