简体   繁体   中英

Attaching f:ajax to h:panelGroup

Whenever I try to attach a f:ajax to h:panelGroup I get an error:

Parent is not composite component or of type ClientBehaviorHolder

I used to be able to do it with Richfaces and JSF 1.2. Is there a workaround? Should I bring in Richfaces 4.0?

It's odd since it's obviously possible (I do it with jQuery for client side actions)

UPDATE Richfaces 4.0 won't help. 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. f:ajax can only be used for components that implement the javax.faces.component.behavior.ClientBehaviorHolder interface and h:panelGroup doesn't.

You can wrap your components inside the panelGroup with a surrounding ajax tag:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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