empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1373858 - in /empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2: pageelements/StaticListPageElement.java pages/Page.java
Date Thu, 16 Aug 2012 14:21:34 GMT
Author: doebele
Date: Thu Aug 16 14:21:34 2012
New Revision: 1373858

URL: http://svn.apache.org/viewvc?rev=1373858&view=rev
Log:
EMPIREDB-157
provide opportunity to override pageElement initialization for StaticListPageElement

Modified:
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pageelements/StaticListPageElement.java
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/Page.java

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pageelements/StaticListPageElement.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pageelements/StaticListPageElement.java?rev=1373858&r1=1373857&r2=1373858&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pageelements/StaticListPageElement.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pageelements/StaticListPageElement.java
Thu Aug 16 14:21:34 2012
@@ -60,5 +60,11 @@ public class StaticListPageElement<T> ex
         this.items = items;
         getTableInfo().init(items.size(), 0);
     }
+    
+    public void update()
+    {
+        if (items!=null)
+            getTableInfo().init(items.size(), 0);
+    }
 
 }

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/Page.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/Page.java?rev=1373858&r1=1373857&r2=1373858&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/Page.java (original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/Page.java Thu
Aug 16 14:21:34 2012
@@ -384,21 +384,39 @@ public abstract class Page implements Se
     public void doInit()
     {
         if (pageElements != null)
-        { // Init Page Elements
+        {   // Init Page Elements
             for (PageElement pe : pageElements)
-                pe.onInitPage();
+                doInitElement(pe);
         }
     }
 
     public void doRefresh()
     {
         if (pageElements != null)
-        { // Init Page Elements
+        {   // Refresh Page Elements
             for (PageElement pe : pageElements)
-                pe.onRefreshPage();
+                doRefreshElement(pe);
         }
     }
     
+    /**
+     * called by doInit() to initialize a particular page element
+     * @param pe the page element to initialize
+     */
+    protected void doInitElement(PageElement pe)
+    {
+        pe.onInitPage();
+    }
+    
+    /**
+     * called by doRefresh() to refresh a particular page element
+     * @param pe the page element to refresh
+     */
+    protected void doRefreshElement(PageElement pe)
+    {
+        pe.onRefreshPage();
+    }
+    
     /* Helpers */
     
     protected final TextResolver getTextResolver()



Mime
View raw message