myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Iov <>
Subject Re: Pagination of large database tables
Date Mon, 19 Feb 2007 16:00:52 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Thanks Mohammad, but i don't think, it meets all of my needs :) I'm
using A4j/Facelets to provide flexible and CONSISTENT templating
support to the customers. It would be really strange to make some
exception just because one of used UIComponents don't work correctly.
The problem with t:dataScroller is that it generates
duplicated/inconsistent IDs if the underlying DataModel changes. So
I've extended the ac:AjaxDataScroller by Adrian Mitev to support events
and it works fine. I think, one custom UIComponent, which does exactly
what it have to do is much better than one, which provides "workaround"
for some other.<br>
But if you use PPRPanelGroup of Tomahawk Sandbox components you can add
Ajax-support to your page easily and it work woth dataScroller perfectly<br>
  <div><span class="gmail_quote">On 2/19/07, <b
Paul Iov</b> &lt;<a href=""></a>&gt;
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
    <div bgcolor="#ffffff" text="#000000">Hi Pallavi!<br>
First of all take a look at
    <a href=""
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"></a>.
The illustrating
code there is IMHO a little bit buggy (especially for subsets of large
datasets, which commes from EJB it makes no sense to fetch the same
page twice, since the sorting order never chahges), but generally this
approach works fine.<br>
I have exactly the same usecase - large resultsets and fetching on
demand, but I'm using ac:AjaxDataScroller insteed of <span><font
 face="Arial" size="2">&lt;t:dataScroller&gt;,
because the second one is not Ajax-compatible :( Any way, with own
extended implementation</font></span> of DataModel im background it
would be preaty easy to implement "fetch more" feature, you are asking
    <a href="" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)"></a>
    <div><span class="e" id="q_110da22427302a2a_1">
      <div><span><font face="Arial" size="2">Hi
      <div><span></span> </div>
      <div><span><font face="Arial" size="2">I
currently have a requirement for pagination.</font></span></div>
      <div><span><font face="Arial" size="2">I
want the following GUI display &lt;&lt;1 2 3 4 5 more &gt;&gt;.</font></span></div>
      <div><span><font face="Arial" size="2">Where
on click of &lt;&lt; is for previous.</font></span></div>
      <div><span><font face="Arial" size="2">And
on click of &gt;&gt; is for next.</font></span></div>
      <div><span><font face="Arial" size="2">So
with these two i could go ahead with &lt;t:dataScroller&gt; for the
above mentioned functionlity.</font></span></div>
      <div><span><font face="Arial" size="2">But
if i had the advantage of knowing the total number of rows with DB to
perform COUNT operation on the total number of rows.</font></span></div>
      <div><span></span> </div>
      <div><span><font face="Arial" size="2">But
for larger tables this wouldn't be efficient.</font></span></div>
      <div><span><font face="Arial" size="2">Hence
the requirement demands fetching rows in multiples of 250.</font></span></div>
      <div><span><font face="Arial" size="2">And
each page displaying 50 rows per page.</font></span></div>
      <div><span><font face="Arial" size="2">With
the click on more it would fetch the next 250 rows.</font></span></div>
      <div><span><font face="Arial" size="2">And
the display should look like &lt;&lt; 6 7 8 9 10 More
&gt;&gt;.(something similar to google's pagination).</font></span></div>
      <div><span></span> </div>
      <div><span><font face="Arial" size="2">Is
there a way by which i can implement this.</font></span></div>
      <div><span><font face="Arial" size="2">Or
can i extend the functionality of &lt;t:dataScroller&gt; to implement
      <div><span><font face="Arial" size="2">Any
suggestions are welcome.</font></span></div>
      <div><span></span> </div>
      <div><span></span> </div>
      <div><span><font face="Arial" size="2">Best
      <div><span><font face="Arial" size="2">Pallavi </font></span></div>
      <div><span></span> </div>
      <div><span></span> </div>
      <div><span></span> </div>
      <div><span></span> </div>
            <td bgcolor="#ffffff"><font color="#000000"><br>
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
addressee(s) and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of
viruses. The company accepts no liability for any damage caused by any
virus transmitted by this email.<br>
            <a href="" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)"></a><br>
  <br clear="all">
-- <br>

View raw message