3 Replies Latest reply on Sep 18, 2013 1:18 PM by bleathem

    Migration from Richfaces 3 to 4

    samkirans

      Currently we are in process of migrating our code from richface 3 to richfaces 4.

      we have integrated Spring with JSF.

       

      The following code snippet is not invoking the bean method which used to work in Richfaces 3.x.

      <rich:tab label="Scope" action="#{auditBean.scopeTabClicked}" >

       

      I tried with  itemChangeListener in <rich:tabPanel> , that worked. But i dont want that approach.  as i need to invoke different method on each tab click.

        • 1. Re: Migration from Richfaces 3 to 4
          bleathem

          rich:tab action and actionLIstener should work, see the vdl doc:

          http://docs.jboss.org/richfaces/latest_4_X/vdldoc/rich/tab.html

           

          You can't use switchType=client though, and your tab has to be in a form.  Can you post a complete (yet simplified) facelet sample?

          • 2. Re: Migration from Richfaces 3 to 4
            samkirans

            Hi below the sample code .

             

            <h:head></h:head>
            <h:body>
            <h:form>
                <rich:tabPanel switchType="ajax">
                <rich:tab label="tab1" action="#{bean.tab1Clicked}">
                    <c:if test="#{bean.isTab1Clicked}">
                        <ui:include src="pages/SubTab1.xhtml"/>
                    </c:if>
                </rich:tab>
                <rich:tab label="tab2" reRender="component1,component2" action="#{bean.openList}">
                    <c:if test="#{bean.isTab2Clicked}">
                        <ui:include src="pages/SubTab1.xhtml"/>
                    </c:if>
                </rich:tab>
                <rich:tabPanel>
            </h:form>
            </h:body>
            
            • 3. Re: Migration from Richfaces 3 to 4
              bleathem

              Your problem here is your use of the c:if tags.  The JSTL tags are evaluated at the time the component tree is built during the RESTORE_VIEW phase.  This is before the results of your postback are applied and the view rendered.  Use the rendered attribute (of a h:panelGroup for instance) to control conditional rendering.  Reserve use of the JSTL c:if tag for when you wnat to keep the size of the component tree in check (for performance reasons) based on conditions that will not vary from one page to the next.