1 Reply Latest reply on Apr 12, 2011 5:55 PM by Chris Mathrusse

    Trouble with rich:popupPanel

    Chris Mathrusse Newbie

      I'm using richfaces 4.0.0 Final and I'm hitting a problem with the rich:popupPanel when executing in IE. It works perfectly in Safari, Firefox and Chrome, but when it comes to IE, it simply doesn't do what it should.

       

      I've defined a simply maven application, that can be imported into Eclipse, and have attached it to this thread. It simply consists of 2 pages; test1.xhtml & test2.xhtml. test1.xhtml is defined as with <html> as the starting element:

       

      <!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:h="http://java.sun.com/jsf/html"

        xmlns:composite="http://java.sun.com/jsf/composite"

        xmlns:ui="http://java.sun.com/jsf/facelets"

        xmlns:f="http://java.sun.com/jsf/core"

        xmlns:a4j="http://richfaces.org/a4j"

        xmlns:rich="http://richfaces.org/rich">

       

      <f:view>

       

        <h:head>

        <h:outputStylesheet library="css" name="style.css" target="head" />

        </h:head>

       

        <h:body>

       

        <h:form>

        <h:panelGrid styleClass="content-panel">

       

        <h:panelGroup id="global-messages">

        <h:messages style="color:red" globalOnly="true" />

        </h:panelGroup>

       

        <h:commandButton value="Test 1 - Call the popup">

        <rich:componentControl target="busyModal" operation="show" />

        </h:commandButton>

        </h:panelGrid>

       

        </h:form>

        </h:body>

       

          <ui:include src="/include/busy-modal.xhtml" />

       

      </f:view>

      </html>

       

       


      test2.xhtml is defined as a <ui:component> and utilizes the template attribute.

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <ui:composition template="/include/layout.xhtml"

          xmlns="http://www.w3.org/1999/xhtml"

          xmlns:h="http://java.sun.com/jsf/html"

          xmlns:composite="http://java.sun.com/jsf/composite"

          xmlns:ui="http://java.sun.com/jsf/facelets"

          xmlns:f="http://java.sun.com/jsf/core"

          xmlns:a4j="http://richfaces.org/a4j"

          xmlns:rich="http://richfaces.org/rich">

       

          <ui:define name="content">

              <h:form>

                  <h:panelGrid styleClass="content-panel">

       

                      <h:panelGroup id="global-messages">

                          <h:messages style="color:red" globalOnly="true" />

                      </h:panelGroup>

       

                      <h:commandButton value="Test 2 - Call the popup">

                          <rich:componentControl target="busyModal" operation="show" />

                      </h:commandButton>

                  </h:panelGrid>

       

              </h:form>

          </ui:define>

      </ui:composition>

       

      layout.xhtml is very simple as well.

      <html xmlns="http://www.w3.org/1999/xhtml"

        xmlns:ui="http://java.sun.com/jsf/facelets"

        xmlns:h="http://java.sun.com/jsf/html"

        xmlns:fn="http://java.sun.com/jsp/jstl/functions"

        xmlns:a4j="http://richfaces.org/a4j"

        xmlns:rich="http://richfaces.org/rich"

        xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">

      <f:view>

       

          <h:head>

              <h:outputStylesheet library="css" name="style.css" target="head" />

          </h:head>

       

        <h:body> 

        <div id="container">

                            <ui:insert name="content" />

        </div>

       

        </h:body>

       

          <ui:include src="/include/busy-modal.xhtml"/>

       

      </f:view>

       

      </html>

       

       

      As I stated, both pages work perfectly in Safari, Firerfox and Chrome, but only test1.xhtml works correctly in IE. While this works correctly, it seems somewhat restrictive if I have to write all of my pages in this fashion. I'm hoping that I am simply doing something incorrectly that will allow me to use templating as I have outlined in test2.xhtml.

       

      That's for taking a look at this and helping me out.

        • 1. Trouble with rich:popupPanel
          Chris Mathrusse Newbie

          I think I found the solution to my issue. I was using <ui:composition> for all of my pages when in fact I should be using

          <ui:decorate>

           

          Per the documentation:

           

          The <ui:decorate> tag provides the same features as the <ui:composition>, but it causes any content surroundig the <ui:decorate> tag to be included in the page, rather than be trimmed, as in the case of <ui:composition>.

           

          I guess IE is very particulate with respect to the generated HTML but by changing to a <ui:decorate> tag, the popupPanel now works as expected.