简体   繁体   English

将f:ajax附加到h:panelGroup

[英]Attaching f:ajax to h:panelGroup

Whenever I try to attach a f:ajax to h:panelGroup I get an error: 每当我尝试将f:ajax附加到h:panelGroup ,都会出现错误:

Parent is not composite component or of type ClientBehaviorHolder 父级不是复合组件,也不是ClientBehaviorHolder类型

I used to be able to do it with Richfaces and JSF 1.2. 我曾经能够通过Richfaces和JSF 1.2做到这一点。 Is there a workaround? 有解决方法吗? Should I bring in Richfaces 4.0? 我应该引入Richfaces 4.0吗?

It's odd since it's obviously possible (I do it with jQuery for client side actions) 这很奇怪,因为它很可能(我使用jQuery进行客户端操作)

UPDATE Richfaces 4.0 won't help. 更新 Richfaces 4.0将无济于事。 Tried it and get the same error. 尝试过并得到相同的错误。

Code Sample: 代码示例:

<li>
  <f:param value="#{contact.getUUID}" name="currContactUUID" /> 
  <f:ajax event="click" onevent="console.log('Event Happend in panelgroup')" >
    <h:panelGroup styleclass="contacts_tab_contacts_list_quickview_box">
        <h:outputText value="#{contact.firstName} #{contact.familyName}"/>
    </h:panelGroup>
  </ajax>
</li>

That shouldn't be possible for a panelGroup. 对于panelGroup来说这不可能。 f:ajax can only be used for components that implement the javax.faces.component.behavior.ClientBehaviorHolder interface and h:panelGroup doesn't. f:ajax仅可用于实现javax.faces.component.behavior.ClientBehaviorHolder接口的组件,而h:panelGroup则不能。

You can wrap your components inside the panelGroup with a surrounding ajax tag: 您可以使用周围的ajax标签将组件包装在panelGroup中:

<f:ajax>
 ... (your components here)
</f:ajax>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM