5 Replies Latest reply on Sep 5, 2007 3:38 PM by Igor Shabalov

    datascroller page index after reload

    ilhami visne Newbie

      I'm using Richfaces 3.1.0 RC3 in Seam 2. There is search site of my application, where the results are shown in paginated table.

      If i now looking at page 8 and then make a new search, that means a new table but ,let say, only with 3 pages. it shows nothing, because there is nothing on page 8.

      How can i reset the page index of datascroller after a new search?

      thanks :)

        • 1. Re: datascroller page index after reload
          Igor Shabalov Apprentice

          1. I guess you re-render datascroller together with datatable when you make a new search?

          2. You can use component binding and use setPage(String command) on UIDatascroller like this:

          <rich:datascroller binding="#{bean.scroller}" ....>

          Bean.java:

          public void reset() {
          ((UIDatascroller)getScroller()).setPage("first");
          }

          • 2. Re: datascroller page index after reload
            ilhami visne Newbie

            1. Yes. datascroller is between the as footer.

            2. I got it. But one Question: To do that, i need to import UIDataScroller class, which is not in the api (richfaces-api-3.1.0-rc3.jar). I use EAR deployment and trying to access it from myapp.jar. Should i use reflection?

            • 3. Re: datascroller page index after reload
              Igor Shabalov Apprentice

              I recommend put all your backing beans to war, it is definitely a part of the presentation. Therefore, you can use UIDataScroller from your backing beans.

              Code that implement such function like reset of data scroller belongs to presentation tier.

              • 4. Re: datascroller page index after reload
                ilhami visne Newbie

                 

                "ishabalov" wrote:
                I recommend put all your backing beans to war, it is definitely a part of the presentation. Therefore, you can use UIDataScroller from your backing beans.

                Code that implement such function like reset of data scroller belongs to presentation tier.


                Actually i am new in this Java EE area and following the seam examples. I believe that they are well designed. Seam developers didn't put any java class in the war folder.

                How about this: I make a class and methods, which does things like setting page index and then just call the EJB methods.

                Thank you for your feedbacks! it helps a lot.

                • 5. Re: datascroller page index after reload
                  Igor Shabalov Apprentice

                  I guess Seam developers do not need such advanced function like you need in there samples. There is nothing wrong having Java classes in presentation tier, and your situation is perfect for such case. Backing beans must be in web tier.