Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么复合jsf标记不在ajax调用中调用侦听器?_Ajax_Jsf_Primefaces_Composite Component - Fatal编程技术网

为什么复合jsf标记不在ajax调用中调用侦听器?

为什么复合jsf标记不在ajax调用中调用侦听器?,ajax,jsf,primefaces,composite-component,Ajax,Jsf,Primefaces,Composite Component,我最近将一些代码从视图移动到复合jsf标记,以使代码更简洁,但我刚刚意识到ajax调用不再有效 浏览器进行了更新,我可以看到数据显示,但是这个方法并没有被称为all 我将以下代码作为标记: <composite:interface> <composite:attribute name="viewBean" type="org.example.view.RegistroMunicipalView" required="true" /> </composite:in

我最近将一些代码从视图移动到复合jsf标记,以使代码更简洁,但我刚刚意识到ajax调用不再有效

浏览器进行了更新,我可以看到数据显示,但是这个方法并没有被称为all

我将以下代码作为标记:

<composite:interface> 
 <composite:attribute name="viewBean" type="org.example.view.RegistroMunicipalView" required="true" />
</composite:interface>

<composite:implementation>
 <saimTags:dataFlag viewBean="#{cc.attrs.viewBean}"/>
  <p:selectOneMenu  styleClass="source_select" value="#{cc.attrs.viewBean}" >
      <f:selectItems value="#{cc.attrs.viewBean.registros}" var="registro" 
                     itemValue="#{registro.idRegistro}"
                     itemLabel="#{registro.nombre}"></f:selectItems>
      <p:ajax listener="#{cc.attrs.viewBean.registroChanged()}" oncomplete="checkForData()" update="@(.section_content)"/>

   </p:selectOneMenu>
</composite:implementation>
就像这个标签的实现一样

<saimTags:displayRegistro viewBean="#{informacionMunicipalView}"/>


有什么可能出错的线索吗?

这是由于selectOneMenu中的属性值错误造成的, 它指向的是bean,而不是导致静默故障的idRegistro属性,通过此更改,该方法现在被正确调用

之前:

<p:selectOneMenu  styleClass="source_select" value="#{cc.attrs.viewBean}" >

之后:

<p:selectOneMenu  styleClass="source_select" value="#{cc.attrs.viewBean.idRegistro}" >

<p:selectOneMenu  styleClass="source_select" value="#{cc.attrs.viewBean.idRegistro}" >