Problem using toggleControl+togglePanel with Ajax support.
marcioemiranda Sep 26, 2007 2:45 PMHello,
My original problem is that I need a collapsible panel with Ajax support and a customizable header. If simpleTogglePanel had a customizable header it would be fine for me, but I understand that it hasn't (there is an open ticket for that in JIRA). By customizable I mean a header facet where I could add additional buttons in the header.
Said that, I tried to develop the same functionality of simpleTogglePanel using a combination of toggleControl+togglePanel. I created then the following Facelets composition to handle that (work in progress):
============================================
<ui:composition
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<rich:togglePanel initialState="collapsed" switchType="client" stateOrder="collapsed,expanded">
<f:facet name="expanded">
<rich:panel>
<f:facet name="header">
<rich:toggleControl value="Topic name (expanded)" switchToState="collapsed"/>
</f:facet>
<rich:dragSupport dragIndicator=":indicator"
dragType="topic" dragValue="1" rendered="#{userBean.editorialRights}">
<rich:dndParam name="label" value="nome topico" />
</rich:dragSupport>
Panel content goes here.#{hotSpot1Bean.hotSpotId}
</rich:panel>
</f:facet>
<f:facet name="collapsed">
<rich:panel bodyClass="invisible">
<f:facet name="header">
<rich:toggleControl value="Topic name (collapsed)" switchToState="expanded"/>
</f:facet>
<rich:dragSupport dragIndicator=":indicator"
dragType="topic" dragValue="1" rendered="#{userBean.editorialRights}">
<rich:dndParam name="label" value="nome topico" />
</rich:dragSupport>
</rich:panel>
</f:facet>
</rich:togglePanel>
</ui:composition>
==========================================
Now, here is the problem. If I configure the togglePanel to use Ajax and use more than one instance of the composition defined above, the component gets lost after the first operation (collapse/expand). If I use only one composition it works well.
If I configure the togglePanel to use the client type instead of ajax, it works fine even if I use more than one instance of the composition described above.
What do you suggest? It seems to me that there is a bug when the combination of toggleControl+togglePanel is used more than once in the same view with ajax support.
Thanks