6 Replies Latest reply on Aug 2, 2010 11:40 AM by baranjsf

    orderingList how can I get new order ?

    misqu23

      Hi

      I'm using richfaces 3.2. I've got the problem with orderingLst component. I can get selection but I don't know how to get the new order of items ?

      Does anybody knows solution ?

      Thanks in advance

      Martin

        • 1. Re: orderingList how can I get new order ?
          nbelaevski

          Martin,

          "value" attribute of orderingList will contain re-ordered collection of original elements after request processing by JSF is complete.

          • 2. Re: orderingList how can I get new order ?
            baranjsf

            Hi there,

            I have this problem too. In my backing bean, the value of ordering list, my list, has old order. Please help me.

            • 3. Re: orderingList how can I get new order ?
              baranjsf

              Hi there,

              I have orderinglist, but I could not get the new order in my backing bean. Would you plz help me?

              It is my ordering list:

               

              My rankList will be initialized in init() method in my backing bean:

               

              rankList = new ArrayList<Rank>();
              rankList.add(new Rank("Alabama Montgomery"));
                  rankList.add(new Rank("Alaska Juneau"));
                  rankList.add(new Rank("Arizona Phoenix"));
                  rankList.add(new Rank("Arkansas Little Rock"));
                  rankList.add(new Rank("California Sacramento"));
                  rankList.add(new Rank("Colorado Denver"));
                  rankList.add(new Rank("Connecticut Hartford"));
                  rankList.add(new Rank("Delaware Dover"));
                  rankList.add(new Rank("Florida Tallahassee"));
                  rankList.add(new Rank("Georgia Atlanta"));
                  rankList.add(new Rank("Hawaii Honolulu"));
                  rankList.add(new Rank("Idaho Boise"));
              

              and it is my findEperts method in my backing bean:

               

              public void findExperts (){

                  System.out.println("FIND EXPERT:Hi"+rankList);
                  resultsList.clear();
                  BusinessLogic bs = new BusinessLogic();
                  resultsList = bs.search(searchedTopicList);
                 
              }

              and it is my convertor:

               

              public class StringToRankListConverter implements Converter {
                  public Object getAsObject(FacesContext context, UIComponent component, String value) {
               
                      System.out.println("StringToRankListConverter value: "+value.toString());
                      String[] words = value.split (":");
                      String name = words[0];
                    
               
                      Rank wonder = new Rank(name);
               
                      return wonder;
                  
                      
                  }    
                  public String getAsString(FacesContext context, 
                            UIComponent component, Object value) {
                           return value.toString();
                  }
               
              }
              

              Sometimes  a4j:support calls my findexperts method, and  sometimes does not call. But I saw in my setRankList and getrankList and  findExpert method that the rankList has the old order, not a new order.

              Thank in advance


              • 4. Re: orderingList how can I get new order ?
                ilya_shaikovsky

                at first add rich:messages to the page to check if the converter works fine.

                • 5. Re: orderingList how can I get new order ?
                  baranjsf

                  Hi Ilya,

                  I used System.out.println in my converter.

                  In the converter the order is ok, but in SET and GET accessors, the order is wrong. I do not know y?

                  • 6. Re: orderingList how can I get new order ?
                    baranjsf

                    I added massages, no messages.