4 Replies Latest reply on Feb 24, 2015 7:03 PM by santoshvarma

    jsf 2.2 and rf 4.5.1 upgrade breaks my rich:tree

    santoshvarma

      I recently upgraded from JSF 2.1.28 + RF 4.3.7 to JSF 2.2.9 + RF 4.5.1 and below code which was working fine started failing.

      <rich:tree var="item" id="attributesTree" toggleNodeEvent="click" toggleType="client">

           <rich:treeModelAdaptor nodes="#{attributeTreeBean.categoryGroup}">

                <rich:treeNode expanded="#{attributeTreeBean.rowsAndColumnsTreeChildrenExpanded}"

                               rendered="#{item.categoryGroupName eq 'rowsandcolumns'}">

                     <h:outputText value="#{item.categoryGroupName}" class="inforTree rf-trn-lbl" />

                </rich:treeNode> 

                <rich:treeModelAdaptor id="categoriesAdaptor" nodes="#{item.categories}"

                     rendered="#{item.categoryGroupName eq 'rowsandcolumns'}">

                <rich:treeNode iconClass="no-icon" expanded="#{attributeTreeBean.rowsAndColumnsTreeLeavesExpanded}">

                     #{item.categoryName}

                </rich:treeNode>

          

      In the first level rich:treeModelAdaptor nodes=#{attributeTreeBean.categoryGroup} returns a List and each CategoryGroup is assigned to item variable in rich:tree var

      inside first rich:treeNode item.categoryGroupName refers to CategoryGroup.categoryGroupName and works fine.

      When it reaches nested rich:treeModelAdaptor nodes=#{item.categories} it returns List and each Category is assigned to item. This is where in the same rich:treeModelAdaptor definition the part rendered="#{item.categoryGroupName eq 'rowsandcolumns'}" looks for Category.categoryGroupName instead of CategoryGroup.categoryGroupName and fails with PropertyNotFoundException.

      The same code works fine before Richfaces upgrade. Is there any major change in RF 4.5.1 that can cause this?

      Thank you

        • 1. Re: jsf 2.2 and rf 4.5.1 upgrade breaks my rich:tree
          michpetrov

          Hi,

           

          I'm unable to replicate this, in my test the variable resolves correctly. Note that Mojarra 2.2.9 was released after RichFaces 4.5.1, if something changed there we wouldn't have known. Although as I said it works for me. What server are you using?

          • 2. Re: jsf 2.2 and rf 4.5.1 upgrade breaks my rich:tree
            santoshvarma

            Hi,

            Thanks for the response.

             

            I've tried with JSF 2.1.29 with 4.5.1 and that works fine too. I tried multiple combinations of Richfaces and JSF versions and it seems to be failing for all Richfaces 4.5.x versions.

            BTW, I'm using Weblogic 12.1.3 and following are some additional dependencies, if it matters at all.

             

                     <dependency>

                        <groupId>com.google.code.gson</groupId>

                        <artifactId>gson</artifactId>

                        <version>2.3.1</version>

                    </dependency>

             

             

                    <dependency>

                        <groupId>org.atmosphere</groupId>

                        <artifactId>atmosphere-runtime</artifactId>

                        <version>1.0.18</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.glassfish.web</groupId>

                        <artifactId>javax.el</artifactId>

                        <version>2.2.6</version>

                    </dependency>

            • 3. Re: jsf 2.2 and rf 4.5.1 upgrade breaks my rich:tree
              bleathem

              Can you provide a Short, Self Contained, Correct Example (eg, a bean and facelet we can drop into an RF project) that we can use to replicate this behaviour?

              • 4. Re: jsf 2.2 and rf 4.5.1 upgrade breaks my rich:tree
                santoshvarma

                Thank you Brian for the response. I could not reproduce the issue on a small example. After multiple tries and debugging through RF code, I could get away with this exception by commenting below code in UIDataAdaptor.java

                 

                DataVisitorForVisitTree.process() method

                 

                if (!dataChild.getParent().isRendered() && visitContext.getHints().contains(VisitHint.SKIP_UNRENDERED)) {

                   // skip unrendered columns

                   continue;

                }

                 

                This is changed in 4.5.1 for the issue [RF-12654] PartialViewRender skips check for whether column is rendered before checking if children can be rendered - JB…

                 

                Thanks,

                Santhosh