From: <jma...@rh...> - 2009-04-11 20:44:34
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [3694] only load the data for each tabular display ONCE;</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>3694</dd> <dt>Author</dt> <dd>jmarques</dd> <dt>Date</dt> <dd>2009-04-11 15:44:33 -0500 (Sat, 11 Apr 2009)</dd> </dl> <h3>Log Message</h3> <pre>only load the data for each tabular display ONCE; duplicate loads happened because the first time into the method the pageList was null, and the second time into the method the lastViewId was different because we didn't initialize it in the null path; however the very nature of the PagedListDataModel is such that it has a one-to-one correlation with some facelet and/or PageControlView construct; as such, the lastViewId handling is (and perhaps never was) needed, and removing it causes ALL implementors of the PagedListsDataModel to only query the backing store once; </pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqtrunkmodulesenterpriseguiportalwarsrcmainjavaorgrhqenterpriseguicommonpagingPagedListDataModeljava">rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunkmodulesenterpriseguiportalwarsrcmainjavaorgrhqenterpriseguicommonpagingPagedListDataModeljava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java (3693 => 3694)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java 2009-04-11 20:40:17 UTC (rev 3693) +++ rhq/trunk/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java 2009-04-11 20:44:33 UTC (rev 3694) </span><span class="lines">@@ -56,7 +56,6 @@ </span><span class="cx"> private int currentRowIndex; private PageControlView pageControlView; private PageList<T> pageList; </span><span class="rem">- private String lastViewId; </span><span class="cx"> private String beanName; /** </span><span class="lines">@@ -124,16 +123,6 @@ </span><span class="cx"> pageList = getDataPage(pageControl); } </span><span class="rem">- // the user has previously been to this view, and is returning - else if (!FacesContext.getCurrentInstance().getViewRoot().getViewId().equals(lastViewId)) { - PageControl pageControl = getPageControl(); - lastViewId = FacesContext.getCurrentInstance().getViewRoot().getViewId(); - pageList = getDataPage(pageControl); - } - - // no longer needed because changes to the PageControl as a result of getting results are repersisted automatically - //setPageControl(pageList.getPageControl()); - </span><span class="cx"> return pageList; } </span> </pre> </div> </div> </body> </html> |