找不到成分与标识H:selectBooleanCheckbox P外侧:数据表primefaces [英] Cannot find component with identifier h:selectBooleanCheckbox outside p:datatable primefaces

查看:134
本文介绍了找不到成分与标识H:selectBooleanCheckbox P外侧:数据表primefaces的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经这样code。在我的应用程序 我希望到h提交:selectBooleanCheckbox价值的服务器, H:selectBooleanCheckbox内号码:TabView的和p之外:dataTable中 我想提交H:从selectBooleanCheckbox值 电话号码:AJAX程序=scenarioTabViewId:isApprovedBooleanId_checkBox scenarioTabViewId:isApprovedBooleanId_checkBox这是Firefox v23.0创建复选框ID 和scenarioTabViewId:budgetAnalysisDataTableId这是数据表ID 任何一个可以explan,我该怎么办呢? 这是实际的code在.xhtml

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

在此先感谢

推荐答案

首先,删除&LT; H:形式prependId =假&GT; 。这是一个与阿贾克斯不兼容。不要忘了,现在给的形式固定ID。

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">

其次,过程属性是你的情况不对,你正在使用的EL EX pression与组件的cliend ID作为EL范围内的变量。这是不作任何意义。只要是一个正常的字符串。

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.

引用正确的客户端ID的规则可以在以下答案中找到:<一href="http://stackoverflow.com/questions/8634156/how-to-reference-components-in-jsf-ajax-cannot-find-component-with-identifier/8644762#8644762">How引用组件的JSF AJAX?无法找到标识符QUOT组成部分;富&QUOT;鉴于。应用了,它应该是这个样子(注意 preFIX):

The rules of referencing the proper client ID can be found in the following answer: How to reference components in JSF ajax? Cannot find component with identifier "foo" in view. Applying that, it should look something like this (note the : prefix):

process=":formId:scenarioTabViewId:isApprovedBooleanId_checkBox"

另一种方法是物理CheckBox组件绑定到,像这样的观点:

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

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

,然后引用它的客户端ID与的 UIComponent#getClientId() 像这样(也是在这里,请注意 preFIX):

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

process=":#{checkbox.clientId}"

这篇关于找不到成分与标识H:selectBooleanCheckbox P外侧:数据表primefaces的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆