myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: How are you paging large datasets?
Date Mon, 11 Dec 2006 19:13:34 GMT
"using datascroller then you cannot convey starting at the middle of a
result upon returning from another page"

Yes you can. See my code for the extended data table:

  public void setFirst(int first)
  {
    ValueBinding vb = getValueBinding("first");
    if (vb != null)
    {
      vb.setValue(getFacesContext(), first);
      return;
    }
    else
      super.setFirst(first);
  }

Then use EL in your data table:

<t:dataTable first="#{myBean.first}" >...


There is no bug to fix, but you have to work around the fact that the
dataScroller calls UIData.setFirst(number). By default, all JSF components,
when invoked with a set method (and not a value binding set), store the
local value as a member value and never check the value binding value again.
By overriding the behavior of the HtmlDataTable, you can make sure that
calls to setFirst update the EL expression value instead of the UIData's
member variable. So it will always use EL to determine the first row.

-Andrew


On 12/11/06, albartell <albartell@gmail.com> wrote:
>
> That is actually what I used as the basis for my code I posted in my link.
> The problem is that scrolling functionality is not included in the example
> so I am left to believe that he is using datascroller, and if he is using
> datascroller then you cannot convey starting at the middle of a result
> upon
> returning from another page without modifying bugs in the tomahawk release
> (per another response in this thread).
>
> Maybe my situation is unique in that I am trying to preposition the result
> to a page other than the first page.
>
> Aaron Bartell
>
> -----Original Message-----
> From: Hazem Saleh [mailto:hazem.saleh@gmail.com]
> Sent: Monday, December 11, 2006 10:42 AM
> To: MyFaces Discussion
> Subject: Re: How are you paging large datasets?
>
> Check Cagatay solution for that problem
>
> http://www.jroller.com/page/cagataycivici?entry=jsf_datatable_with_custom_pa
> ging
> It was really a great solution.
>
> On 12/11/06, albartell <albartell@gmail.com> wrote:
> >
> > Now that I know the datascroller component most likely will not work
> > for my large datasets, I am curious to know how others that are
> > writing enterprise level apps with MyFaces have accomplished the task.
> > Note that my problem with datascroller is that you can't initialize it
> > to be at a particular page and have it reflect that in the hyperlinked
> page numbers.
> >
> > Specifically:
> >
> > 1. How are you loading large datasets x number of records at a time
> > into MyFaces components? (I have figured this out using my own method
> > which is detailed in this forum post: http://tinyurl.com/ym2l73)
> >
> > 2. What UI component are you using to allow the user to go to the
> > next/previous page? Did you create your own? Is there an existing
> component?
> >
> > Thanks in advance for any help,
> > Aaron Bartell
>
>
> --
> Hazem Ahmed Saleh Ahmed
> IBM Egypt Cairo TDC ( Technology Development Center ) WebSphere Business
> Integration Modeler Software Engineer
> http://www.jroller.com/page/HazemBlog
>
>

Mime
View raw message