1 Reply Latest reply on Jun 12, 2012 1:54 PM by Christian Peter

    f:ajax / a4j:ajax destroys rich:tooltips displayed in a rich:tree when render="@form"

    Karsten Wutzke Expert

      Hello,

       

      I have the following code:

       

      {code}

        <h:body>

          <h:form>

            <rich:tree value="#{nodeManager.rootTreeNode}"

                       var="treeNode"

                       nodeType="#{treeNode.emitCode}"

                       toggleType="client">

       

              <rich:treeNode type="root">

       

                <h:panelGrid columns="4">

                  <h:outputText value="#{treeNode.name}" id="node-name" />

                  <rich:tooltip value="The name is..." direction="bottomRight" target="node-name" />

                  <h:commandLink value="Add...">

                    <rich:tooltip value="Add chapter" direction="bottomRight" />

                    <a4j:ajax render="root-add-chapter-popup" oncomplete="#{rich:component('root-add-chapter-popup')}.show()" />

                  </h:commandLink>

                </h:panelGrid>

              </rich:treeNode>

       

            </rich:tree>

       

            <rich:popupPanel modal="true"

                             domElementAttachment="form"

                             onmaskclick="#{rich:component('root-add-chapter-popup')}.hide(); return false;"

                             id="root-add-chapter-popup">

              <f:facet name="header">

                <h:outputText value="Add Chapter" />

              </f:facet>

              <h:panelGrid columns="1" style="margin: 0px auto;">

                <h:commandButton value="Rerender form and hide!">

                  <!--a4j:ajax render="@form" onclick="#{rich:component('root-add-chapter-popup')}.hide(); return true;" /-->    <!-- works -->

                  <!--f:ajax render="@form" onclick="#{rich:component('root-add-chapter-popup')}.hide(); return true;" /-->      <!-- breaks tooltips -->

                  <a4j:ajax render="@form" oncomplete="#{rich:component('root-add-chapter-popup')}.hide(); return true;" /> <!-- breaks tooltips -->

                </h:commandButton>

              </h:panelGrid>

            </rich:popupPanel>

       

          </h:form>

        </h:body>{code}

       

      When rerendering the form (h:commandButton render="@form") via f:ajax onclick="" or a4j:ajax oncomplete="" the rich:tooltip elements on the rich:treeNode are lost. Note that a4j:ajax onclick="" is working. It doesn't make much sense to me why the others aren't working.

       

      So, is this a bug?

       

      Karsten