8 Replies Latest reply on Nov 30, 2010 6:21 AM by nbelaevski

    Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2

    bsingh1408

      Hi,

       

      I have tried to migrate an existing application from Richfaces 3.3.3 JSF 1.2 to Richfaces 4.0.0 M4 with JSF2, and I have encountered the following issues during the build using maven

       

       

      Component/Class Issues:     3.3.3                                         4.0.0.M4
      PushEventListener            - org.ajax4jsf.event                              not found               
      Modifiable                          - org.richfaces.model                        not found
      HtmlComboBox                 -  org.richfaces.component.html                not found
      UIPickList                          - org.richfaces.component                    not found
      SortField2                     - org.richfaces.model                             not found
      TreeNode                      - org.richfaces.model                         org.richfaces.component.UITreeNode
      TreeNodeImpl                 - org.richfaces.model                             not found
      HtmlTree                      - org.richfaces.component.html                not found
      HeaderEncodeStrategy    - org.richfaces.renderkit                         not found
      FormUtil                          - org.richfaces.component.util                 org.richfaces.renderkit.util
      RequestContext            - org.richfaces.context                             not found
      Ordering                         - org.richfaces.model                             not found
      RendererUtils                 - org.ajax4jsf.renderkit                         not found
      DataTableRenderer        - org.richfaces.renderkit.html                  org.richfaces.renderkit
      SimpleToggleEvent        - org.richfaces.event                             not found
      NodeExpandedEvent        - org.richfaces.event                             not found
      ExtendedFilterField          - org.richfaces.component                         not found
      DataTableIconSortAsc    - org.richfaces.renderkit.html.iconimages    not found

       

      class DataTableRenderer method Issues
      isColumnRendered(javax.faces.component.UIComponent)                            
      encodeStyleClass(javax.faces.context.ResponseWriter,<nulltype>,java.lang       
      getUtils()                                                                    
      renderChild(javax.faces.context.FacesContext,javax.faces.component.UICom

       

      class UIColumn method issues
      isSelfSorted()
      getSortIconAscending()
      getSortIconDescending()
      getSortIcon()

       

      class DataTableRenderer method Issues
      method isColumnRendered(javax.faces.component.UIComponent)                            
      method encodeStyleClass(javax.faces.context.ResponseWriter,<nulltype>,java.lang       
      method getUtils()                                                                    
      renderChild(javax.faces.context.FacesContext,javax.faces.component.UICom

       

      class UIColumn method issues
      method isSelfSorted()
      method getSortIconAscending()
      method getSortIconDescending()
      method getSortIcon()

       

      Alot of the components and classes used as part Richfaces 3.3.3 are not available in Richfaces 4.0.0 M4 or have been moved.

       

      Is there a migration document for Richfaces 3.3.x to Richfaces 4. Which components can be used as in 3.3.X and which ones have changed.

       

      It was ok to migrate from Richfaces 3.3.2 to Richfaces 3.3.3 and JSF 1.2 to JSF 2.0.2. It looks like a big effort to migrate to Richfaces 4  for an existing application.

       

      Please advise a good strategy to migrate.

       

       

      Thanks,

      B.

        • 1. Re: Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2
          ilya_shaikovsky

          unfortunatelly we still in progress for creation migration docs/samples... So better way for now - explore demos (rf-showcase in distribution) for components available and usage samples. And follow-up http://community.jboss.org/wiki/RichFaces40ReleaseCenter to check info on further migrations.

           

          Will try to add info according to your list. It will be usefull for all the guys:


          PushEventListener            - org.ajax4jsf.event                              not found               

          Push completelly redesigned for using Comet and JMS support. Currently info available at developer demo only. We will create official demos asap.

           

          Modifiable                          - org.richfaces.model                        not found

          Just renaimed to ArrangeableModel and Arrangeable interface.


          HtmlComboBox                 -  org.richfaces.component.html                not found

          SuggestionBox and ComboBox unified to single autocomplete component. And b.t.w. for dynamic creation it's better to use Application.createComponent(componentType) rather than new html*();

           

          UIPickList                          - org.richfaces.component                    not found

          not planned even to final. We planning to redesign ListShuttle(questionable for first final) to more simple implementation so we will have no need in that ligh-weight clone component.


          SortField2                     - org.richfaces.model                             not found

          Look to ArrangeableState. We unified the fields.

           

          TreeNode                      - org.richfaces.model                         org.richfaces.component.UITreeNode

          TreeNodeImpl                 - org.richfaces.model                             not found

          Will be in M5

           

          HtmlTree                      - org.richfaces.component.html                not found

          Again - use create component and component type(org.richfaces.Tree) for dynamic creation and you will not depends on concrete html impl classes. That one removed.

           

          HeaderEncodeStrategy    - org.richfaces.renderkit                         not found

          RequestContext            - org.richfaces.context                             not found

          Not used and I can't comment much without knowing for what you using it.

           

          FormUtil                          - org.richfaces.component.util                 org.richfaces.renderkit.util

          yes refactored and present in M4

           

          Ordering                         - org.richfaces.model                             not found

          see org.richfaces.component.SortOrder


          RendererUtils                 - org.ajax4jsf.renderkit                         not found

          refactored. moved to org.richfaces.renderkit.util

           

          DataTableRenderer        - org.richfaces.renderkit.html                  org.richfaces.renderkit

          refactored moved.

           

          SimpleToggleEvent        - org.richfaces.event                             not found

          see now component is collapsiblePanel and PanelToggleEvent

           

          NodeExpandedEvent        - org.richfaces.event                             not found

          see TreeToggleEvent


          ExtendedFilterField          - org.richfaces.component                         not found

          need to check more

           

          DataTableIconSortAsc    - org.richfaces.renderkit.html.iconimages    not found

          there is no built-in sort filter controls right now. so no such images classes.

           

          class DataTableRenderer method Issues
          isColumnRendered(javax.faces.component.UIComponent)                            
          encodeStyleClass(javax.faces.context.ResponseWriter,<nulltype>,java.lang       
          getUtils()                                                                    
          renderChild(javax.faces.context.FacesContext,javax.faces.component.UICom

           

          just refactoring. need details about your problems related to it.

           

          class UIColumn method issues
          isSelfSorted()
          getSortIconAscending()
          getSortIconDescending()
          getSortIcon()

          As written above - no built-in controls for now so no such methods and classes.

           

           

           

          hope it will be usefull for you. I will make that thread sticky to make the thread more public and helpfull for others.

          Thanks for your efforts with migration!

          • 2. Re: Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2
            nbelaevski

            >> TreeNode                      - org.richfaces.model                         org.richfaces.component.UITreeNode
            >> TreeNodeImpl                 - org.richfaces.model                             not found

             

            UITreeNode is not a model class. Use UITree instead of HtmlTree.

            • 3. Re: Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2
              asschwab

              Hi,

               

              is there a possiblity in 4.0.0 M4 to select nodes in the tree via the API. If so, how can I do it? If not, can I use a nightly build (@Nick: I'ven seen you checked some stuff in some days ago ;-)  ). If so, which Listener class to use and which attribute to use in the rich:tree tag?

               

              I certainly could also use Javascript directly, but as we will use the Final in our release anyway, I'd prefer to use the API - method if possible.

               

              Thanks in advance

              Andreas

              • 4. Re: Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2
                nbelaevski

                Andreas,

                 

                There is "selection" attribute that accepts collection of row keys to be selected. Currently only a single selection is supported, so this has to be singleton set.

                • 5. Re: Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2
                  asschwab

                  Hi Nick,

                   

                  thank you for your answer. I think I didn't express well enough what I was thinking about.

                  In RF 3.3.3 I used the tag 'nodeSelectListener' and  bound it to an instance of a NodeSelectionListener implementing public void processSelection(NodeSelectionEvent event) to react to a node selection event.

                  I find the org.richfaces.event.TreeSelectionListener in RF 4.0.0 with the method public void processSelection(TreeSelectionEvent event). Is this the equivalent to the older NodeSelectionListener?

                  What I don't know is, which tag attribute to use in rich:tree.

                  In RF 3.3.3 I uses nodeSelectListener and I also set the ajaxSubmitSelection to true. How is this accomplished in RF 4.0? And is it correct to change from switchType="ajax" to toggleType="ajax"?

                   

                  Thanks in advance

                  Andreas

                  • 6. Re: Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2
                    nbelaevski

                    Currently attribute's name is 'selectionChangeListener' and it can be set at tree component, not treeNode. Listener accepts TreeSelectionChangeEvent.

                     

                    Yes, there are selectionType = (client | ajax) and toggleType = (ajax | client | server) attributes.

                    • 7. Re: Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2
                      asschwab

                      Thanks a lot, Nick, I only cannot find TreeSelectionChangeEvent in M4. Is there a nightly build I could use?

                       

                      Thanks in advance.

                      Andreas

                      • 8. Re: Migrate Richfaces 3.3.x to Richfaces 4.0.0 M4 and JSF2
                        nbelaevski

                        Yes, nightly build should be available in our snapshots repository.