myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Iov <p...@voller-ernst.de>
Subject Re: Tomahawk+DataScroller+WorkingWithLargeTables
Date Thu, 05 Jul 2007 23:55:26 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<p class="MsoNormal"><span style="" lang="EN-US">...Well,
let's check it step by step. In my JSP (2 Daniel):<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&lt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 127);"
 lang="EN-US">ac:ajaxDataScroller
</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"
 lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 127);"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">rendered</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"#{Recherche.data.rowCount gt 0}"</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">id</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"scroller" </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">for</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"tblData" </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">fastStep</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"10"</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">renderCurrentAsText</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"false"</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">maxPages</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"9" </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">ajaxSingle</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"true"<span style=""> </span>/</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&gt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">...<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&lt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 127);"
 lang="EN-US">t:dataTable <o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">id</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"tblData" </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">value</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"#{Recherche.data}"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">var</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"foto"</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">rowId</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"#{foto.id}"
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">rows</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"#{Recherche.rowsPerPage}"<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">newspaperColumns</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"4" </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">newspaperOrientation</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"horizontal"</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&gt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&lt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 127);"
 lang="EN-US">t:column</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&gt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&lt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 127);"
 lang="EN-US">ui:include </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">src</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"mediaview.xhtml"</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&gt;&lt;/</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 127);"
 lang="EN-US">ui:include</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&gt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&lt;/</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 127);"
 lang="EN-US">t:column</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&gt;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&lt;/</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(63, 127, 127);"
 lang="EN-US">t:dataTable</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;"
 lang="EN-US">&gt;</span><span style="" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">I think,
the lines<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">var</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"foto"</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 127);"
 lang="EN-US">rowId</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">=</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);"
 lang="EN-US">"#{foto.id}"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">are
essential in JSP. I may be wrong, but the dataTable needs to identify
the items
somehow...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">I've
collected also the 'bean's code' from some levels of class hierarchy:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">//in bean
itself<o:p></o:p></span></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">public</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"> </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">final</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">
DataModel <span
 style="background: silver none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">getData</span>(){</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">return</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"> _getPagedList().getDataModel();</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">}<o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">//'standard' implementation of
_getPagedList() in base class:<o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">//(Since I have many different PagedLists,
the common methods<o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">//are extracted to).<o:p></o:p></span></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">private </span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">IPagedList</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);"
 lang="EN-US"> _pagedList = null;</span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US"><o:p></o:p></span></b></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">protected</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">
IPagedList <span
 style="background: silver none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">_getPagedList</span>()
{</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"
 lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt;"><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">if</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"> (</span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">null</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"> == </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);"
 lang="EN-US">_pagedList</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">) {//pay attention to this check!</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);"
 lang="EN-US">_pagedList</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"> = </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">new</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">
PagedListFoto(GetMiddlewareConnector());</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left: 35.4pt; text-indent: 35.4pt;"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);"
 lang="EN-US">_pagedList</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">.setRowsPerPage(</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);"
 lang="EN-US">rowsPerPage</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">););</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">return</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US"> </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);"
 lang="EN-US">_pagedList</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"
 lang="EN-US">}</span><span style="" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">The private
member _pagedList is also initializes 'lazy' -&gt; just once per
instance.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="" lang="EN-US">Then in
PagedList. <o:p></o:p></span></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"
 lang="EN-US">private</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> DataModel
dataModel;</span><span style="" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">public</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
PagedListFoto(SesEJBConnector ejbConnector){</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">super</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(ejbConnector);</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">dataModel</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> = </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">null</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="" lang="EN-US">This one we
have discuss early...</span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"><o:p></o:p></span></b></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">public</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
DataModel <span
 style="background: silver none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">getDataModel</span>()
{</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="">&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">_log</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.debug(</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);">"--------------
GetDataModel() called -------"</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">if</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> (</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">dataModel</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> ==
</span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">null</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> ||
</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">_invalidated</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">) {</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">dataModel</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> = </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">new</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
LocalDataModel(</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">rowsPerPage</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">_invalidated</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> = </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">false</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;
//set 'dirty'
flag</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">return</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">dataModel</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">And then
very deeply in base class:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">constructor<o:p></o:p></span></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">public</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> <span
 style="background: silver none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">PagedListBase</span>(SesEJBConnector
ejbConnector){</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">_log</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> =
LogFactory.<i>getLog</i>(</span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">this</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.getClass());</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">myConnector</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> =
ejbConnector;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">internalStorage</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> = </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">new</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
ArrayList&lt;Integer&gt;();//list of IDs</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">_invalidated</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> = </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">true</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span><span
 style="" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">public</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">int</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> <span
 style="background: silver none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">getCount</span>(){</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">return</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">internalStorage</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.size();</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span><span
 style="" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">//
this two
methods are used during fetching of page data</span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);"><o:p></o:p></span></b></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">protected</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
List&lt;Integer&gt; <span
 style="background: silver none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">getSubList</span>(</span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">int</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
startRow, </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">int</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
pageSize){</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">int</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
toIndex = Math.<i>min</i>(</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">internalStorage</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.size(),
startRow + pageSize);</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">return</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">internalStorage</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.subList(startRow,
toIndex);</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}<o:p></o:p></span></p>
<p class="MsoNormal" style=""><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">protected</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
String
getStrIdCommaList(List&lt;Integer&gt; subList){</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>StringBuffer sb = </span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">new</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
StringBuffer();</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">for</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(Integer
ID : subList)</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sb.append(sb.length() == 0 ?
ID.toString() : </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(42, 0, 255);">","</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">+ID.toString());</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">return</span></b><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
sb.toString();</span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}<o:p></o:p></span></p>
<p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">Well... not
especially clear, but still better then nothing :) The rest (how the
items are
fetched) was in rar. </span><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">How
and from where to populate this internal storage should be
trivial.</span><span style="" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">I have no
ideas, why the framework access getDataModel() again on going to
another
application page, but after many hours studying of source code of
original
t:dataScroller it's not really great surprise to me :) It was exactly
the
reason to use ac:ajaxDataScroller instead.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">2 Vlad<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">Daniel was
quicker with the answer. I've traced this again in my code... two calls
to
getDataModel() should be the only source of duplicated DB access.
(Regardless
of bean's scope, two components access this property.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">2 Vladimir<o:p></o:p></span></p>
<p class="MsoNormal"><strong><span style="" lang="EN-US">&gt;DEBUG
=== LocalDataModel.fetchPage startRow: 0 pageSize: 5&nbsp;&nbsp;&nbsp; ??????? </span></strong><b><span
 style="" lang="EN-US"><br>
&gt;</span></b><span style="" lang="EN-US">DEBUG **Fetch:
required -&gt; fetching..<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">I'm not
sure if it's not a result of some "preserve data model"-tricks (of
t:dataScroller? dataTable?)... Any way, it's not the same class
instance where
the old (startRow/pageSize) values are stored :) I would try to log
instance's
hash or check the scope of bean.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">&gt; 2.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">I think,
this property is simply omitted in .tld or facelet taglib. In fact the
scroller
is a composed component. It consists of (at least) panelGrid, some
commandLink-s and facet-s. So it's just not clear, which one should use
this
value :) Anyway I'll be wondering, if this warning affects the fetching.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">And
generally, about the strategy to handle large recordsets... I don't
think, some
really better solution is possible :) The scroller needs this total
record
count to know, how many pages to generate. (Don't forget: the DataModel
must
also can be able to 'report' this value.) In my implementation I have
an
internal storage... let's say, an ArrayList of IDs (integer or long),
so I'm doing
not separate "select count(*)..." but "select ID from..."
(with all filtering/ordering stuff) already in constructor and fill
this list
just once. After this I have the total count automatically and each
statement
to fetch particular data page is "select ... where ID in(...)". Since
the field is indexed, it's pretty quick... probably, the best possible
choice.
I have extra implemented the dirty flag to force 'hard' reload of this
internal
list, if some changes was made, that can affect the order or total
count of
items (edit/add/delete). The call hierarchy in fetching chain is
trivial:
getInternalList().getSublist(). The first one reloads the IDs if data
are
'dirty' (this happens during first call from constructor), the second
composes
IDs of requested subset (page) into comma separated string. Since I'm
working
with EBJ, I haven't to reload whole dataset each time when just one
'record' is
changed - if the entity was successfully persisted, I have already the
actual
'copy'. (I guess Daniel, you are using event listener in your backing
bean to
edit data directly in PagedList? It's the only way to have actual copy
displayed without to reload this page.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">I'm working
with kind of snapshot (search results) with extra buffering. My
internal 'in
memory' page is up to five times larger as my displayed page. Since the
user
can adjust the count of displayed items, I'm adjusting also the size of
internal buffer dynamically to keep roundtrip time reasonably even if
'on next
page' the next internal frame of data must be fetched. I try also to
predicate
'next' portion of fetched data, but it's different long story :) That's
why I'm
not posting all of my code... it's scattered over dozen of classes and
packages
:) This simple strategy (even without predication) works fine for me.
By
resultsets of 20000~30000 records and displayed page of<span style="">&nbsp;
</span>8-80 items (5~7 joined tables each) the
response time is under 500ms (normally 40~60ms / click)
(JBoss/EJB3/Oracle)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">If the
dataset must be really 'live' (I mean, if after each click the
page/scroller
must reflect the data in DB EXACTLY), it should be also necessarily to
implement some smart strategy to keep 'current' page over roundtrip
etc. (The
first one thinkable pitfall with t:dataScroller: we are at page n with
m items
per page. Then we navigate to n+1 and back, but the items are not more
the
same-&gt; someone have added m items to the dataset and they are now
displayed
at page n due to sorting order.) However I'm not sure, if one really
needs in
this case some datascroller... rather some scroller with fixed length
of
resultset (?may be, incremented on demand etc.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-US">paul<o:p></o:p></span></p>
<br>
Vladimir Isakovich schrieb:
<blockquote
 cite="mid:d4c9ef920707051122i394a2dfct53145cc187453e85@mail.gmail.com"
 type="cite">
  <div>Hi, Paul, Daniel&nbsp;and all list.</div>
  <div>I'm really glad finding this discussion, I guess in all serious
projects there is a need&nbsp;for&nbsp;reading large tables. I was reading&nbsp;the
Wiki page, and had a trouble of implementing it, though after reading
this thread I've got it working, at least to some extent.
  </div>
  <div>I'm using Facelets 1.1.11 with MyFaces 1.1.3 -snapshot and
tomahawk 1.1.3 (I was trying later versions, but facelets complained on
server start, althoug I did not see real issues). The DB is MySql 5 and
Hibernate is DB wrapper..
  </div>
  <div>&nbsp;</div>
  <div>I do have some questions (3 total):</div>
  <div>1. I've added your method in my bean:</div>
  <div>&nbsp;</div>
  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public DataPage&lt;Customer&gt; fetchPage(int startRow,
int pageSize) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log.debug("=== LocalDataModel.fetchPage startRow: "+
startRow+" pageSize: "+pageSize);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return <strong>doFetchPage(</strong>startRow, pageSize);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div>
  <div>Still, I can see two DB roundtrips when doing 'next page'</div>
  <div>this is what I see in the log:</div>
  <div>
  <p>OPENING PAGE First Time - no problem</p>
  <p>Jul 5, 2007 1:12:09 PM com.sun.facelets.tag.jsf.ComponentRule
warnAttr<br>
WARNING: /web/sec/examples/largeTableScroller.xhtml @104,85 border="1"
Property 'border' is not on type:
org.apache.myfaces.component.html.ext.HtmlGraphicImage
  <br>
DEBUG === LocalDataModel.fetchPage startRow: 0 pageSize: 5<br>
DEBUG **Fetch: required -&gt; fetching...<br>
DEBUG === Gettin new page. startRow = 0 size: 5<br>
DEBUG attempting to initialize the SessionFactory<br>
INFO&nbsp; Hibernate 3.2.4.sp1<br>
..... multiple infos from Hibernate about session
initialization.........<br>
Hibernate: select this_.Cust_ID as Cust1_0_0_, this_.Name as Name0_0_,
this_.Phone_Number as Phone3_0_0_, this_.Street_A<br>
ddress as Street4_0_0_, this_.City as City0_0_, this_.State as
State0_0_ from customers this_ limit ?
  <br>
DEBUG === LocalDataModel.fetchPage startRow: 0 pageSize: 5<br>
DEBUG ***Fetch: not required (already fetched)!<br>
INFO&nbsp; entering RESTORE_VIEW(1) in
org.apache.myfaces.lifecycle.LifecycleImpl<br>
INFO&nbsp; entering RESTORE_VIEW(1) in
org.apache.myfaces.lifecycle.LifecycleImpl</p>
  <p>SCROLLING TO THE NEXT PAGE - unwanted read</p>
  <p>INFO&nbsp; entering RESTORE_VIEW(1) in
org.apache.myfaces.lifecycle.LifecycleImpl<br>
INFO&nbsp; entering APPLY_REQUEST_VALUES(2) in
org.apache.myfaces.lifecycle.LifecycleImpl<br>
  <strong>DEBUG === LocalDataModel.fetchPage startRow: 0 pageSize: 5&nbsp;&nbsp;&nbsp;
???????
  <br>
  </strong>DEBUG **Fetch: required -&gt; fetching...<br>
DEBUG === Gettin new page. startRow = 0 size: 5<br>
Hibernate: select this_.Cust_ID as Cust1_0_0_, this_.Name as Name0_0_,
this_.Phone_Number as Phone3_0_0_, this_.Street_A
  <br>
ddress as Street4_0_0_, this_.City as City0_0_, this_.State as
State0_0_ from customers this_ limit ?<br>
DEBUG Page Size: 5<br>
DEBUG === LocalDataModel.fetchPage startRow: 0 pageSize: 5<br>
DEBUG ***Fetch: not required (already fetched)!
  <br>
  <strong>DEBUG === LocalDataModel.fetchPage startRow: 5 pageSize: 5&nbsp;&nbsp;&nbsp;
- this is what was expected<br>
  </strong>DEBUG **Fetch: required -&gt; fetching...<br>
DEBUG === Gettin new page. startRow = 5 size: 5<br>
Hibernate: select this_.Cust_ID as Cust1_0_0_, this_.Name as Name0_0_,
this_.Phone_Number as Phone3_0_0_, this_.Street_A
  <br>
ddress as Street4_0_0_, this_.City as City0_0_, this_.State as
State0_0_ from customers this_ limit ?, ?<br>
DEBUG Page Size: 5<br>
INFO&nbsp; entering RESTORE_VIEW(1) in
org.apache.myfaces.lifecycle.LifecycleImpl<br>
INFO&nbsp; entering RESTORE_VIEW(1) in
org.apache.myfaces.lifecycle.LifecycleImpl</p>
  <p>Well, apparently the framework (can I say it better?) is calling
fetchPage() twice. First - with the old startRow value and second -with
the new startRow value.</p>
  <p>2. I also can see a warning:WARNING:
/web/sec/examples/largeTableScroller.xhtml @104,85 border="1" Property
'border' is not on type:
org.apache.myfaces.component.html.ext.HtmlGraphicImage<br>
but it seems that the property gets applied. (I can see the differense
in apearance, when the border=1 is removed).
  </p>
  <p>3. I also have a question about dataSize in your DataPage. Does it
mean that the for a first time I have to run something like "select
count(*)..." and then store this value to the session, so it may be
retrieved for all consecutive reads? Do you have a better solution?
  </p>
  <br>
&nbsp;</div>
  <div><span class="gmail_quote">On 7/5/07, <b class="gmail_sendername">Paul
Iov</b> &lt;<a moz-do-not-send="true" href="mailto:paul@voller-ernst.de">paul@voller-ernst.de</a>&gt;
wrote:</span>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">Hi
Daniel,<br>
    <br>
unfortunately I have neither some simple project nor article explaining<br>
this. I have implemented it in my own meta framework which is part of a
    <br>
big commercial application. (It consists currently of 6 or 7 different<br>
Eclipse projects, so it would be really difficult to extract 'clearly'<br>
the code, you are asking for.) I'm attaching just three classes from my
    <br>
early 'playground' code. Sorry, it's the best I can offer right now :(<br>
You will not be able to compile this (because the rest of my stuff have<br>
nothing to do with fetching itself and would be more complicated as
    <br>
helpful) but you can track the approach. There are three methods, which<br>
shows how it works and how to get ride of duplicated (exactly: multiple)<br>
fetching of the same data: getPage() and doFetchPage() in<br>
DataPagedListDataModel&lt;T&gt; and getDataModel() in PagedListFoto
(which
    <br>
extends the DataPagedListDataModel indirectly)<br>
    <br>
The solution is to separate the fetching call into own method in base<br>
abstract class. (Why it should be abstract is explained in Wiki.)<br>
    <br>
&nbsp;&nbsp; private int _lastStartRow = -1;
    <br>
&nbsp;&nbsp; private int _lastPageSize = -1;<br>
&nbsp;&nbsp; private DataPage&lt;T&gt; _lastPage = null;<br>
    <br>
&nbsp;&nbsp; private DataPage&lt;T&gt; doFetchPage(int startRow, int pageSize){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((_lastPage == null) || (_lastStartRow != startRow) ||
    <br>
(_lastPageSize != pageSize)){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _log.debug("**Fetch: required -&gt; fetching...");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _lastPage = fetchPage(startRow, pageSize);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //store values to chech next time<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _lastStartRow = startRow;
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _lastPageSize = pageSize;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _log.debug("***Fetch: not required (already fetched)!");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return _lastPage;<br>
&nbsp;&nbsp; }<br>
    <br>
I store then the startRow and pageSize values and check it every time
    <br>
the new fetch is 'requested'. Just take a look at my debug statements<br>
entire the code, they should be self explained. The fetching take place<br>
exactly one time for particularly page of data.<br>
    <br>
One more thing to be clearly explained here: the getDataModel() of
    <br>
'enclosing' nested class (PagedListFoto in my case)&nbsp;&nbsp;MUST BE CALLED<br>
TWICE, since you have two components in your JSP -&gt; the DataTable and<br>
the Scroller and both are accessing this property. So you have to
handle
    <br>
this situation yourself, i.e. directly in getter:<br>
    <br>
public DataModel getDataModel() {<br>
&nbsp;&nbsp;&nbsp;&nbsp; _log.debug("-------------- getDataModel() called -------");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (dataModel == null) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dataModel = new LocalDataModel(rowsPerPage);
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return dataModel;<br>
}<br>
    <br>
I hope it helps.<br>
    <br>
Regards,<br>
paul<br>
    <br>
P.S. As mentioned, I'm not using t:dataScroller since it's buggy in<br>
combination with AJAX (at least: it WAS buggu in 1.1.4 and 1.1.5), but I<br>
think, it makes no difference regarding fetching approach itself. I've<br>
send my code with few minor improvements to Adrian Mitev (author of<br>
original component, which was published at<br>
    <a moz-do-not-send="true"
 href="https://ajax4jsf.dev.java.net/servlets/ProjectDocumentList?folderID=6510&amp;expandFolder=6510&amp;folderID=5320">https://ajax4jsf.dev.java.net/servlets/ProjectDocumentList?folderID=6510&amp;expandFolder=6510&amp;folderID=5320
    </a>).<br>
If you are interested in this component, just ask him about it.<br>
    <br>
daniel ccss schrieb:<br>
&gt;<br>
&gt; Thanks!!!<br>
&gt;<br>
&gt; Paul do you have a simple project where I can see how all working<br>
&gt; together, I'm really tire of search and search for solutions and
    <br>
&gt; nothing , I&acute;m new in this and really need help, thanks!!<br>
&gt;<br>
&gt;<br>
&gt; P.D: have you publish some article explaining how all this works
(your<br>
&gt; DataScroller using AjaxDataScroller and the approach of the
wiki)?...
    <br>
&gt; you should i know that many people will appreciate it!<br>
&gt;<br>
    <br>
    <br>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
</body>
</html>

Mime
View raw message