2 Replies Latest reply on May 3, 2013 7:32 AM by alsha

    RF4: hide/show popupPanel using rendered-attribute does not work with domElementAttachment="body"

    alsha

      Hi *,

       

      in my case i use rendered-attribute to hide or show popupPanel (show attribute is always true).

       

      The following example shows the panel correctly, but hide does not work.

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
        xmlns:c="http://java.sun.com/jsp/jstl/core" xml:lang="en" lang="en">
      <h:head></h:head>
      
      <h:body>
        <a4j:log hotkey="M" mode="popup" />
        <h:form id="f">
          <a4j:commandLink value="show" render="x">
            <f:setPropertyActionListener target="#{sessionObjectMap['value']}" value="#{true}" />
          </a4j:commandLink>
        </h:form>
      
      
        <h:panelGroup id="x">
          <rich:popupPanel rendered="#{sessionObjectMap['value']}" show="true" domElementAttachment="body">
            <h:form>
              <a4j:commandLink value="hide" render="x" execute="@this">
                <f:setPropertyActionListener target="#{sessionObjectMap['value']}" value="#{false}" />
              </a4j:commandLink>
            </h:form>
          </rich:popupPanel>
        </h:panelGroup>
      </h:body>
      
      </html>
      

       

      sessionObjectMap - is a simple HashMap with session scope.

       

      What am i doing wrong? Is it not correct usage of the component?

       

      Many thanks in advance,

       

      Alexey