无法将 <p:ajax> 附加到非 ClientBehaviorHolder 父级
Unable to attach <p:ajax> to non-ClientBehaviorHolder parent
我正在尝试调用一个函数来从下拉列表中选择一个值。这是我的代码:
<h:form id="frmUpload" enctype="multipart/form-data">
<p:column><h:outputText value="Select Team: " /></p:column>
<p:column>
#{' '}
<h:selectOneMenu required="true" id="ddlTeam" value="#{telesalesUpload.selectTeam}">
<f:selectItem itemValue="0" itemLabel="Dunning Team" />
<f:selectItem itemValue="1" itemLabel="SAVD Team" />
</h:selectOneMenu>
#{' '}
<p:ajax process="@this" event="change" listener="#{telesalesUpload.UpdateTeam}" />
</p:column>
<h:outputText value="Note: first row will be skipped as header row!" />
<p:fileUpload fileUploadListener="#{telesalesUpload.handleFileUpload}"
process = "ddlTeam"
auto="true"
mode="advanced"
update="messages,:frmData"
allowTypes="/(\.|\/)(csv|jpe?g|png)$/"/>
<p:growl id="messages" showDetail="true"/>
但我收到此错误:无法附加到非 ClientBehaviorHolder 父级
你必须把<p:ajax>
放在<p:selectOneMenu>
里面。
<p:column>
#{' '}
<p:selectOneMenu required="true" id="ddlTeam" value="#{telesalesUpload.selectTeam}">
<f:selectItem itemValue="0" itemLabel="Dunning Team" />
<f:selectItem itemValue="1" itemLabel="SAVD Team" />
<p:ajax process="@this" event="change" listener="#{telesalesUpload.UpdateTeam}" />
</p:selectOneMenu>
#{' '}
</p:column>
我正在尝试调用一个函数来从下拉列表中选择一个值。这是我的代码:
<h:form id="frmUpload" enctype="multipart/form-data">
<p:column><h:outputText value="Select Team: " /></p:column>
<p:column>
#{' '}
<h:selectOneMenu required="true" id="ddlTeam" value="#{telesalesUpload.selectTeam}">
<f:selectItem itemValue="0" itemLabel="Dunning Team" />
<f:selectItem itemValue="1" itemLabel="SAVD Team" />
</h:selectOneMenu>
#{' '}
<p:ajax process="@this" event="change" listener="#{telesalesUpload.UpdateTeam}" />
</p:column>
<h:outputText value="Note: first row will be skipped as header row!" />
<p:fileUpload fileUploadListener="#{telesalesUpload.handleFileUpload}"
process = "ddlTeam"
auto="true"
mode="advanced"
update="messages,:frmData"
allowTypes="/(\.|\/)(csv|jpe?g|png)$/"/>
<p:growl id="messages" showDetail="true"/>
但我收到此错误:无法附加到非 ClientBehaviorHolder 父级
你必须把<p:ajax>
放在<p:selectOneMenu>
里面。
<p:column>
#{' '}
<p:selectOneMenu required="true" id="ddlTeam" value="#{telesalesUpload.selectTeam}">
<f:selectItem itemValue="0" itemLabel="Dunning Team" />
<f:selectItem itemValue="1" itemLabel="SAVD Team" />
<p:ajax process="@this" event="change" listener="#{telesalesUpload.UpdateTeam}" />
</p:selectOneMenu>
#{' '}
</p:column>