3
votes

i ve this code in my application i want to submit h:selectBooleanCheckbox value to server, h:selectBooleanCheckbox inside p:tabView and outside p:dataTable i want to submit h:selectBooleanCheckbox value from p:ajax process="scenarioTabViewId:isApprovedBooleanId_checkBox" scenarioTabViewId:isApprovedBooleanId_checkBox this is checkbox id created by firefox v23.0 and scenarioTabViewId:budgetAnalysisDataTableId this is datatable id can any one explan,how can i do this? this is actual code in .xhtml

<ui:composition template="/template/mastertemplate.xhtml">
  <ui:define name="content">
     <h:form styleClass="form" prependId="false">
       <p:panel id="analysisTheBudgetPenel" header="Analysis The Budget">
           <p:tabView id="scenarioTabViewId" style="width:850px">
              <p:tab title="Scenario One" id="scen">
                  <h:selectBooleanCheckbox id="isApprovedBooleanId_checkBox" value="#{budgetAnalysisAction.budgetScenarioHescoProposalBean.abc}" />
                  <p:scrollPanel style="width:800px; height:auto;">
                  <p:dataTable id="budgetAnalysisDataTableId" rowIndexVar="index" editable="true" resizableColumns="true" value="#{budgetAnalysisAction.budgetScenarioHescoProposalBean.budgetScenarioHescoProposalListBean}" var="budgetScenarioHescoProposalList">
                     <p:ajax event="rowEdit" process="#{scenarioTabViewId:isApprovedBooleanId_checkBox}" listener="#{budgetAnalysisAction.testAjax}" />
// some columns
// closing tags of above

thanks in advance

1

1 Answers

2
votes

First of all, remove <h:form prependId="false">. It's incompatible with ajax. Don't forget to give the form a fixed ID now.

<h:form id="formId" styleClass="form">

Secondly, the process attribute is in your case wrong, you were using an EL expression with the component's cliend ID as a variable in the EL scope. This isn't making any sense. Just make it a normal string.

The rules of referencing the proper client ID can be found in the following answer: How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar". Applying that, it should look something like this (note the : prefix):

process=":formId:scenarioTabViewId:isApprovedBooleanId_checkBox"

An alternative would be to bind the physical checkbox component to the view like so:

<p:selectBooleanCheckbox binding="#{checkbox}" ... />

And then reference its client ID with help of UIComponent#getClientId() like so (also here, note the : prefix):

process=":#{checkbox.clientId}"