• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Checkbox value always returns true.  RSS feed

deepa durai
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,

I am using JSF checkbox inside a dataTable.I am calling a javascript function by passing the argument (this object).
The value of the checkbox returns true when checkbox is unchecked.Why is the value always true?
What should be done to get the value as false when the checkbox is unchecked.Can anyone help me?
Please find my code below.

<h:dataTable cellspacing="0" cellpadding="3" width="100%" border="0" value="#{MSPSSecurityProfileDetailsBean.mspsDataModel}" var="item" rowClasses="oddRow, evenRow" headerClass="gridContainer" style="border-bottom:none;">
<h:column styleClass="Header">
<f:facet name="header" width="1%">
<hutputText value="" />
<h:selectBooleanCheckbox id="checkBox1" value="false" onclick="getIndexOfSelectedToremove(this)" valueChangeListener="# {MSPSSecurityProfileDetailsBean.getRemoveSelectableItems}" title="click it to select or deselect" style="width:14px;height:14px;"/>


My javascript:

function getIndexOfSelectedToremove(val){
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!