6 Replies Latest reply on Feb 28, 2009 4:59 AM by prasad_pvk

    Richfaces portlet

      Hi wesley

      I am working on a project that uses richfaces based portlets running in liferay.

      With the following configuration action in context menu is invoked.

      <context-param>
      <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
      <param-value>false</param-value>
      </context-param>
      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
      </context-param>

      However it is breaking ajax calls.

      If the config is opp, false to true, client to server ajax calls are working but action in context menu is failing.

      Could you please provide any inputs or guide me to anyone who can provide help on jboss portletbridge for richfaces in liferay.

      Thank you in advance

        • 1. Re: Richfaces portlet

          Hi wesley

          I am working on a project that uses richfaces based portlets running in liferay.

          With the following configuration action in context menu is invoked.

          <context-param>
          <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
          <param-value>false</param-value>
          </context-param>
          <context-param>
          <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
          <param-value>client</param-value>
          </context-param>

          However it is breaking ajax calls.

          If the config is opp, false to true, client to server ajax calls are working but action in context menu is failing.

          Could you please provide any inputs or guide me to anyone who can provide help on jboss portletbridge for richfaces in liferay.

          Thank you in advance

          
          <?xml version="1.0" encoding="UTF-8"?>
          <web-app id="WebApp_ID" version="2.4"
           xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
           <display-name>liferay_cso</display-name>
           <context-param>
           <param-name>javax.faces.CONFIG_FILES</param-name>
           <param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-config2.xml,/WEB-INF/hierarchy-faces-config.xml,/WEB-INF/quotefaces-config.xml,/WEB-INF/orderfaces-config.xml</param-value>
           </context-param>
           <context-param>
           <param-name>com.sun.faces.verifyObjects</param-name>
           <param-value>true</param-value>
           </context-param>
           <context-param>
           <param-name>com.sun.faces.validateXml</param-name>
           <param-value>false</param-value>
           </context-param>
           <context-param>
           <param-name>org.richfaces.SKIN</param-name>
           <param-value>laguna</param-value>
           </context-param>
           <context-param>
           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
           <param-value>.jsp</param-value>
           </context-param>
           <context-param>
           <param-name>org.ajax4jsf.SKIN</param-name>
           <param-value>blueSky</param-value>
           </context-param>
          
          
          
          
          
           <context-param>
           <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
           <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
           </context-param>
           <!--
           org.jboss.portletbridge.application.FaceletPortletViewHandler
           org.jboss.portletbridge.application.PortletViewHandler
           com.sun.facelets.FaceletViewHandler
           -->
           <context-param>
          <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
          <param-value>false</param-value>
           </context-param>
           <context-param>
           <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
           <param-value>server</param-value>
           </context-param>
          
           <context-param>
           <param-name>org.richfaces.LoadStyleStrategy</param-name>
           <param-value>DEFAULT</param-value>
           </context-param>
           <context-param>
           <param-name>org.richfaces.LoadScriptStrategy</param-name>
           <param-value>DEFAULT</param-value>
           </context-param>
          
          
          
          
          
          
           <context-param>
           <param-name>javax.portlet.faces.renderPolicy</param-name>
           <param-value>ALWAYS_DELEGATE</param-value>
           </context-param>
           <context-param>
           <param-name>javax.faces.LIFECYCLE_ID</param-name>
           <param-value>DEFAULT</param-value>
           </context-param>
           <context-param>
           <param-name>facelets.DEVELOPMENT</param-name>
           <param-value>false</param-value>
           </context-param>
           <context-param>
           <param-name>facelets.SKIP_COMMENTS</param-name>
           <param-value>true</param-value>
           </context-param>
           <context-param>
           <param-name>org.richfaces.CONTROL_SKINNING</param-name>
           <param-value>enabled</param-value>
           </context-param>
           <context-param>
           <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
           <param-value>rfRes</param-value>
           </context-param>
           <context-param>
           <param-name>facelets.REFRESH_PERIOD</param-name>
           <param-value>2</param-value>
           </context-param>
           <context-param>
           <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
           <param-value>NONE</param-value>
           </context-param>
          
          
          
           <filter>
           <display-name>RichFaces Filter</display-name>
           <filter-name>richfaces</filter-name>
           <filter-class>org.ajax4jsf.Filter</filter-class>
           </filter>
           <filter-mapping>
           <filter-name>richfaces</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
           <dispatcher>REQUEST</dispatcher>
           <dispatcher>FORWARD</dispatcher>
           <dispatcher>INCLUDE</dispatcher>
           </filter-mapping>
           <listener>
           <listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
           </listener>
          
           <servlet>
           <servlet-name>Faces Servlet</servlet-name>
           <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
           <load-on-startup>1</load-on-startup>
           </servlet>
           <servlet>
           <servlet-name>SamplePortlet</servlet-name>
           <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
           <init-param>
           <param-name>portlet-class</param-name>
           <param-value>com.sample.portlet.portlet.SamplePortlet</param-value>
           </init-param>
           <load-on-startup>0</load-on-startup>
           </servlet>
           <servlet>
           <servlet-name>orderSummaryPortlet</servlet-name>
           <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
           <init-param>
           <param-name>portlet-class</param-name>
           <param-value>com.sample.portlet.portlet.SamplePortlet</param-value>
           </init-param>
           <load-on-startup>0</load-on-startup>
           </servlet>
           <servlet>
           <servlet-name>demoPortlet</servlet-name>
           <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
           <init-param>
           <param-name>portlet-class</param-name>
           <param-value>com.sample.portlet.portlet.SamplePortlet</param-value>
           </init-param>
           <load-on-startup>0</load-on-startup>
           </servlet>
           <servlet>
           <servlet-name>shopPortlet</servlet-name>
           <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
           <init-param>
           <param-name>portlet-class</param-name>
           <param-value>com.sample.portlet.portlet.SamplePortlet</param-value>
           </init-param>
           <load-on-startup>0</load-on-startup>
           </servlet>
           <servlet>
           <servlet-name>hierarchyPortlet</servlet-name>
           <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
           <init-param>
           <param-name>portlet-class</param-name>
           <param-value>com.sample.portlet.portlet.SamplePortlet</param-value>
           </init-param>
           <load-on-startup>0</load-on-startup>
           </servlet>
           <servlet-mapping>
           <servlet-name>Faces Servlet</servlet-name>
           <url-pattern>*.jsp</url-pattern>
           </servlet-mapping>
          
           <session-config>
           <session-timeout>60</session-timeout>
           </session-config>
           <jsp-config>
           <taglib>
           <taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
           <taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
           </taglib>
           <taglib>
           <taglib-uri>http://liferay.com/tld/portlet</taglib-uri>
           <taglib-location>/WEB-INF/tld/liferay-portlet-ext.tld</taglib-location>
           </taglib>
           <taglib>
           <taglib-uri>http://liferay.com/tld/security</taglib-uri>
           <taglib-location>/WEB-INF/tld/liferay-security.tld</taglib-location>
           </taglib>
           <taglib>
           <taglib-uri>http://liferay.com/tld/theme</taglib-uri>
           <taglib-location>/WEB-INF/tld/liferay-theme.tld</taglib-location>
           </taglib>
           <taglib>
           <taglib-uri>http://liferay.com/tld/ui</taglib-uri>
           <taglib-location>/WEB-INF/tld/liferay-ui.tld</taglib-location>
           </taglib>
           <taglib>
           <taglib-uri>http://liferay.com/tld/util</taglib-uri>
           <taglib-location>/WEB-INF/tld/liferay-util.tld</taglib-location>
           </taglib>
          
           </jsp-config>
          
          </web-app>
          


          • 2. Re: Richfaces portlet
            wesleyhales

            sigh, another cross post.... the bridge is only supported (by me) in JBoss Portal for now. If they or you want to participate in getting things working then we appreciate it.

            • 3. Re: Richfaces portlet

              Thank you very much for your quick response.

              I am using liferay 5.1.2, richfaces3.3.0-GA and jboss portletbridge beta6 version. I have the rich tab working in server, ajax and client mode.

              The server , client and ajax call are working in the portal with richfaces

              However the ajax calls break sometimes ?

              Is the jboss portletbridge 286 complaint?portlet works i

              web.xml is pasted below.. How much of effort

              • 4. Re: Richfaces portlet
                mkatz

                @prasad_pvk If you tell me exactly how to reproduce this problem or provide a running example, I'll look into it.

                Max
                http://mkblog.exadel.com

                • 5. Re: Richfaces portlet

                  Hi mkatz and wesley

                  Thank you for your quick response and help.

                  Please let me know should you need any further information to reproduce the issue.

                  <?xml version="1.0" encoding="UTF-8"?>
                  <web-app id="WebApp_ID" version="2.4"
                   xmlns="http://java.sun.com/xml/ns/j2ee"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
                   <display-name>liferay_cso</display-name>
                   <context-param>
                   <param-name>javax.faces.CONFIG_FILES</param-name>
                   <param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-config2.xml,/WEB-INF/hierarchy-faces-config.xml,/WEB-INF/quotefaces-config.xml,/WEB-INF/orderfaces-config.xml</param-value>
                   </context-param>
                   <context-param>
                   <param-name>com.sun.faces.verifyObjects</param-name>
                   <param-value>true</param-value>
                   </context-param>
                   <context-param>
                   <param-name>com.sun.faces.validateXml</param-name>
                   <param-value>false</param-value>
                   </context-param>
                   <context-param>
                   <param-name>org.richfaces.SKIN</param-name>
                   <param-value>laguna</param-value>
                   </context-param>
                   <context-param>
                   <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                   <param-value>.jsp</param-value>
                   </context-param>
                   <context-param>
                   <param-name>org.ajax4jsf.SKIN</param-name>
                   <param-value>blueSky</param-value>
                   </context-param>
                  
                  
                  
                  
                  
                   <context-param>
                   <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                   <param-value>org.jboss.portletbridge.application.PortletViewHandler</param-value>
                   </context-param>
                   <!--
                   org.jboss.portletbridge.application.FaceletPortletViewHandler
                   org.jboss.portletbridge.application.PortletViewHandler
                   com.sun.facelets.FaceletViewHandler
                   -->
                   <context-param>
                  <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
                  <param-value>true</param-value>
                   </context-param>
                   <context-param>
                   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                   <param-value>server</param-value>
                   </context-param>
                  
                   <context-param>
                   <param-name>org.richfaces.LoadStyleStrategy</param-name>
                   <param-value>NONE</param-value>
                   </context-param>
                   <context-param>
                   <param-name>org.richfaces.LoadScriptStrategy</param-name>
                   <param-value>NONE</param-value>
                   </context-param>
                  
                  
                  
                  
                  
                  
                   <context-param>
                   <param-name>javax.portlet.faces.renderPolicy</param-name>
                   <param-value>ALWAYS_DELEGATE</param-value>
                   </context-param>
                   <context-param>
                   <param-name>javax.faces.LIFECYCLE_ID</param-name>
                   <param-value>DEFAULT</param-value>
                   </context-param>
                   <context-param>
                   <param-name>facelets.DEVELOPMENT</param-name>
                   <param-value>false</param-value>
                   </context-param>
                   <context-param>
                   <param-name>facelets.SKIP_COMMENTS</param-name>
                   <param-value>true</param-value>
                   </context-param>
                   <context-param>
                   <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                   <param-value>enabled</param-value>
                   </context-param>
                   <context-param>
                   <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
                   <param-value>rfRes</param-value>
                   </context-param>
                   <context-param>
                   <param-name>facelets.REFRESH_PERIOD</param-name>
                   <param-value>2</param-value>
                   </context-param>
                   <context-param>
                   <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
                   <param-value>NONE</param-value>
                   </context-param>
                  
                  
                  
                   <filter>
                   <display-name>RichFaces Filter</display-name>
                   <filter-name>richfaces</filter-name>
                   <filter-class>org.ajax4jsf.Filter</filter-class>
                   </filter>
                   <filter-mapping>
                   <filter-name>richfaces</filter-name>
                   <servlet-name>Faces Servlet</servlet-name>
                   <dispatcher>REQUEST</dispatcher>
                   <dispatcher>FORWARD</dispatcher>
                   <dispatcher>INCLUDE</dispatcher>
                   </filter-mapping>
                   <listener>
                   <listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
                   </listener>
                  
                   <servlet>
                   <servlet-name>Faces Servlet</servlet-name>
                   <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                   <load-on-startup>1</load-on-startup>
                   </servlet>
                   <servlet>
                   <servlet-name>SamplePortlet</servlet-name>
                   <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
                   <init-param>
                   <param-name>portlet-class</param-name>
                   <param-value>com.sample.portlet.portlet.SamplePortlet</param-value>
                   </init-param>
                   <load-on-startup>0</load-on-startup>
                   </servlet>
                  
                   <servlet>
                   <servlet-name>demoPortlet</servlet-name>
                   <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
                   <init-param>
                   <param-name>portlet-class</param-name>
                   <param-value>com.sample.portlet.portlet.SamplePortlet</param-value>
                   </init-param>
                   <load-on-startup>0</load-on-startup>
                   </servlet>
                  
                   <servlet-mapping>
                   <servlet-name>Faces Servlet</servlet-name>
                   <url-pattern>*.jsp</url-pattern>
                   </servlet-mapping>
                   <servlet-mapping>
                   <servlet-name>demoPortlet</servlet-name>
                   <url-pattern>/demoPortlet/*</url-pattern>
                   </servlet-mapping>
                   <servlet-mapping>
                   <servlet-name>SamplePortlet</servlet-name>
                   <url-pattern>/SamplePortlet/*</url-pattern>
                   </servlet-mapping>
                   <session-config>
                   <session-timeout>60</session-timeout>
                   </session-config>
                   <jsp-config>
                   <taglib>
                   <taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
                   <taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
                   </taglib>
                   <taglib>
                   <taglib-uri>http://liferay.com/tld/portlet</taglib-uri>
                   <taglib-location>/WEB-INF/tld/liferay-portlet-ext.tld</taglib-location>
                   </taglib>
                   <taglib>
                   <taglib-uri>http://liferay.com/tld/security</taglib-uri>
                   <taglib-location>/WEB-INF/tld/liferay-security.tld</taglib-location>
                   </taglib>
                   <taglib>
                   <taglib-uri>http://liferay.com/tld/theme</taglib-uri>
                   <taglib-location>/WEB-INF/tld/liferay-theme.tld</taglib-location>
                   </taglib>
                   <taglib>
                   <taglib-uri>http://liferay.com/tld/ui</taglib-uri>
                   <taglib-location>/WEB-INF/tld/liferay-ui.tld</taglib-location>
                   </taglib>
                   <taglib>
                   <taglib-uri>http://liferay.com/tld/util</taglib-uri>
                   <taglib-location>/WEB-INF/tld/liferay-util.tld</taglib-location>
                   </taglib>
                  
                   </jsp-config>
                  
                  </web-app>
                  


                  I am using richfaces 3.3.0-GA , jboss portletbridge beta6, liferay 5.1.2

                  I have a jsf in which there is a tabPanel with server, ajax and client slide submits.

                  
                  <ui:composition
                   xmlns="http://www.w3.org/1999/xhtml"
                   xmlns:s="http://jboss.com/products/seam/taglib"
                   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:rich="http://richfaces.org/rich"
                   xmlns:a4j="http://richfaces.org/a4j">
                   <style>
                   .label {
                   font-weight: bold;
                  }
                   .cso_panel_header {
                   font-size: 1em;
                   border-top: 1px solid #017ae2;
                   border-bottom: 1px solid #017ae2;
                   background-color: #4C9600;
                   background: url(../images/layout/gradient.jpg) no-repeat top left;
                  }
                  .rich-stglpanel-marker {float:left}
                   </style>
                   <f:loadBundle basename="order" var="msg"/>
                   <h:form>
                   <rich:tabPanel>
                   <rich:tab label="First">
                   Here is tab #1
                   </rich:tab>
                   <rich:tab label="Second">
                   Here is tab #2
                   </rich:tab>
                   <rich:tab label="Third">
                   Here is tab #3
                   </rich:tab>
                   </rich:tabPanel>
                   <br/><br/>
                   <p>Here is an example of tab panel switched in "ajax" style. Second tab is disabled.</p>
                   <rich:tabPanel switchType="ajax">
                   <rich:tab label="First">
                   Here is tab #1
                   </rich:tab>
                   <rich:tab label="Second" disabled="true">
                   Here is tab #2
                   </rich:tab>
                   <rich:tab label="Third">
                   Here is tab #3
                   </rich:tab>
                   </rich:tabPanel>
                   <br/><br/>
                   <p>Here is an example of tab panel switched completely on client.</p>
                   <rich:tabPanel switchType="client">
                   <rich:tab label="First">
                   Here is tab #1
                   </rich:tab>
                   <rich:tab label="Second">
                   Here is tab #2
                   </rich:tab>
                   <rich:tab label="Third">
                   Here is tab #3
                   </rich:tab>
                   </rich:tabPanel>
                  
                  
                   </h:form>
                  
                  </ui:composition>
                  


                  I have another jsf where the tree has a context menu. one of the menu item has an action and the submit mode is server.

                  <rich:tabPanel switchType="server">
                  
                   <rich:tab label="#{msg['order.offer']}">
                   <h:form id="offerTree">
                   <rich:tree style="width:300px" value="#{orderDetails.offerTree.data}" var="item" nodeFace="#{item.type}"
                   stateAdvisor="#{csoTreeStateAdvisor}">
                  
                   <rich:treeNode type="customer" iconLeaf="/images/customer.gif" icon="/images/customer.gif">
                   <h:outputText value="#{item.name}" id="customerNode"/>
                   </rich:treeNode>
                  
                   <rich:treeNode type="offer" iconLeaf="/images/product_e.gif" icon="/images/product_e.gif" id="offerNode">
                   <h:outputText value="#{item.name}" />
                  
                   <rich:contextMenu event="oncontextmenu" attached="true" attachTo="offerNode" >
                   <rich:menuItem value="$ #{item.recurringCharges} / month" ></rich:menuItem>
                   <rich:menuItem value="$ #{item.oneTimeCharges}" />
                  
                   <rich:menuSeparator height="5"/>
                   <rich:menuItem submitMode="server" value="Details" action="#{orderDetails.details}"></rich:menuItem>
                  
                  
                   </rich:contextMenu>
                  
                   </rich:treeNode>
                  
                   </rich:tree>
                   </h:form>
                   </rich:tab>
                  
                  
                   </rich:tabPanel>
                  


                  With this context params defined in above web.xml, the first page works in ajax, server and client submits. The context menu in the second page fails, the action in the menu item is not forwarding to the next page.

                  However if I change
                  <context-param>
                  <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
                  <param-value>false</param-value>
                   </context-param>
                   <context-param>
                   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                   <param-value>client</param-value>
                   </context-param>
                  
                  

                  the context menu works, but the ajax call in the first page is broken.



                  • 6. Re: Richfaces portlet

                    Hi wesleyhales / mkatz

                    Do you have any inputs after I added jsf and config files?

                    what is the significance of facelets.BUILD_BEFORE_REQUEST ?

                    if this is true ajax calls are working otherwise they break.

                    what is the relation of javax.faces.STATE_SAVING_METHOD to action attribute of rich:menuItem ?

                    My issue is in the liferay portal env. with jboss portletbridge for richfaces context menu works in one config of web.xml and is broken with another config where ajax calls work.

                    With the following configuration action in context menu is invoked.

                    <context-param>
                    <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
                    <param-value>false</param-value>
                    </context-param>
                    <context-param>
                    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                    <param-value>client</param-value>
                    </context-param>

                    However it is breaking ajax calls.

                    If the config is opp, false to true, client to server ajax calls are working but action in context menu is failing.

                    Thanks
                    Prasad