7 Replies Latest reply on Jan 10, 2013 11:45 PM by Sanjeev Shrestha

    Richfaces 4 migration problem

    unzoomed Newbie

      Hi

       

      I'm currently doing a migration from Richfaces 3 -> 4. I have followed the guide available at https://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration, but I have come across some issues that I can not find a solution for.

       

      The problem right now is a HtmlComponentControl that seems to be deprecated and I dont know how I should replace it. The code is as follows:

       

      HtmlComponentControl control = new HtmlComponentControl();

      control.setId("resultMenu");

      control.setEvent("onclick");

      control.setFor("searchMenu");

      control.setOperation("show");

      button.getChildren().add(control);

       

      button is declared as a UICommandButton.

       

      Edit: btw, is there any code tags that I can use on this forum?

        • 1. Re: Richfaces 4 migration problem
          Sanjeev Shrestha Novice

          Hello,

           

          Isn't there something called UIComponentControl? They might have done that. Please have a look. All the other functionalities must be quite similar.

           

          -Sanjeev

          • 2. Re: Richfaces 4 migration problem
            unzoomed Newbie

            That was my first guess to as that seem to be the way that most components have been renamed. But I can not find any UIComponentControl.

            • 3. Re: Richfaces 4 migration problem
              Sanjeev Shrestha Novice

              The best thing to do would be to download the source for Richfaces jar and then see which of the components is associated with rich:componentControl. That would be the class you are looking for. I will reply if I have something of use here.

              • 4. Re: Richfaces 4 migration problem
                Sanjeev Shrestha Novice

                The thing you are looking for is ComponentControlBehavior class. It has the things needed by you please have a look.  It is located inside

                 

                richfaces-4.3.0.20120802-M1\artifacts\ui\richfaces-components-ui-4.3.0.20120802-M1-sources\org\richfaces\component\behavior

                 

                Hope this helps.

                • 5. Re: Richfaces 4 migration problem
                  unzoomed Newbie

                  After some digging I came to the same conclusion and after changing some methods that are no longer implemented I think it works

                  • 6. Re: Richfaces 4 migration problem
                    unzoomed Newbie

                    Got another problem that I can not really figure out now. From what I can see in the guide mentioned in my first post the HtmlAjaxCommandButton is now a UICommandButton and I have changed it accordongly and also changed some of the methods in it with different names. I am however stuck on these two:

                    button.setEventsQueue("searchForm");

                    button.setIgnoreDupResponses(true);

                     

                    I dont know how to replace them, I have read that setIgnoreDupResponse is a part of attachQueue behaviors but I dont know how to fix it. Please can someone give a few pointers?

                     

                    The whole component:

                    UICommandButton button = new UICommandButton();

                    button.setValue(link.getLabel());

                    button.setId("LINK_BUTTON_" + link.getID());

                    button.setStyleClass(button.getStyleClass() + LINK_BUTTON_STYLE);

                    button.addActionListener(navigationAction);

                    button.setRender("searchForm");

                    button.setEventsQueue("renderSearchForm");

                    button.setIgnoreDupResponses(true);

                    button.setExecute(button);

                    buttonCell.getChildren().add(button);


                    • 7. Re: Richfaces 4 migration problem
                      Sanjeev Shrestha Novice

                      Hello,

                       

                      Please make a different thread for this. As the post has been answered so, people may not view your post. They are to avoid duplicate responses. So would disabling the button be an option for you?