4 Replies Latest reply on Apr 11, 2011 10:06 AM by Edilmar Alves

    RichFaces4 menuItem ajax x server

    Edilmar Alves Expert

      Hi,

       

      My development environment is: NetBeans 7.0 RC1 + GlassFish 3.1 + JSF2 + Mojarra 2.1.0 + Weld 1.1 + RichFaces 4 final + Firefox4/Chrome9.

       

      I had a toolBar + dropDownMenu in RF 3.3.3 into a a4j:region, and all menuItems were configured with ajax mode. And a a4j:status + rich:modalPanel to display a message "Processing..." when loading each option, something like this. Then, I migrated to RF 4.0.0 toolbar. Problem: when I use ajax mode, any option doesn't process its xhtml correctly, but if I change to server mode, the xhtml is processed. The other problem is that the server mode doesn't run the a4j:status + rich:popupPanel.

       

      Below is the code for teste.xhtml:

       

      <?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">

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

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

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

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

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

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

                      template="/WEB-INF/templates/templateTeste.xhtml"

                      >

        <ui:define name="content">

          <a4j:log mode="popup">

            <a4j:region id="a4j_menu">

              <a4j:status onstart="#{rich:component('splash')}.show()" onstop="#{rich:component('splash')}.hide()" />

              <rich:popupPanel id="splash" autosized="true" width="200" height="80" moveable="false" resizeable="false">

                <f:facet name="header"><h:outputText value="#{msgGeral['splash.titulo']}" /></f:facet>

                <h:outputText value="#{msgGeral['splash.msg']}" />

              </rich:popupPanel>

              <h:form id="form">

                <rich:toolbar>

                  <rich:dropDownMenu>

                    <f:facet name="label">

                      <h:panelGroup>

                        <h:outputText value="Menu1"/>

                      </h:panelGroup>

                    </f:facet>

                    <rich:menuItem mode="server" label="MenuItem1"

                                   action="#{teste.actionMenuItem1}">

                    </rich:menuItem>

                  </rich:dropDownMenu>

                </rich:toolbar>

              </h:form>

            </a4j:region>

          </a4j:log>

        </ui:define>

      </ui:composition>

       

      The wrong page showed when using ajax mode:

      menuItemAjax.jpeg

      The right same page showed when using server mode:

      menuItemServer.jpeg

      Then, I would like to use ajax mode because of a4j:status+rich:popupPanel, but I would like RichFaces rendered correclty the destination page. I tested with other pages and the result is always the same.