Author: liem_nguyen
Date: 2010-01-17 21:13:08 -0500 (Sun, 17 Jan 2010)
New Revision: 1341
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIRepeater.gtmpl
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/UIDataFeed.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIRepeater.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java
Log:
GTNPORTAL-430 Show exception when delete page in special case (Re-opened)
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIRepeater.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIRepeater.gtmpl 2010-01-18
00:14:27 UTC (rev 1340)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIRepeater.gtmpl 2010-01-18
02:13:08 UTC (rev 1341)
@@ -12,8 +12,7 @@
String name = uicomponent.getLabel() ;
UIForm uiForm = uicomponent.getAncestorOfType(UIForm.class);
- DateFormat dateFormat = null;
- try {
+ DateFormat dateFormat = null;
%>
<div id="$uicomponent.id">
<table class="UIGrid" cellspacing="0">
@@ -90,6 +89,4 @@
%>
</tbody>
</table>
-</div>
-
-<% } catch (java.lang.Throwable e) {} %>
\ No newline at end of file
+</div>
\ No newline at end of file
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/UIDataFeed.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/UIDataFeed.java 2010-01-18
00:14:27 UTC (rev 1340)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/UIDataFeed.java 2010-01-18
02:13:08 UTC (rev 1341)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.bean;
+import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.commons.utils.PageList;
/**
@@ -30,7 +31,12 @@
public void setDataSource(PageList datasource) throws Exception;
- public void feedNext() throws Exception;
+ /***
+ * Load data of next page. Throws DataMissingException when page's data is cannot
load
+ * @throws DataMissingException
+ * @throws Exception
+ */
+ public void feedNext() throws DataMissingException, Exception;
public boolean hasNext();
}
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIRepeater.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIRepeater.java 2010-01-18
00:14:27 UTC (rev 1340)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIRepeater.java 2010-01-18
02:13:08 UTC (rev 1341)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.core;
+import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.util.ReflectionUtil;
import org.exoplatform.webui.bean.UIDataFeed;
@@ -105,7 +106,7 @@
return method.invoke(bean, ReflectionUtil.EMPTY_ARGS);
}
- public void feedNext() throws Exception
+ public void feedNext() throws DataMissingException, Exception
{
int page = datasource.getCurrentPage();
page++;
@@ -113,6 +114,20 @@
{
datasource.getPage(page);
}
+
+ // Check LazyList load current page
+ try
+ {
+ List<?> objects = datasource.currentPage();
+ for (Object obj : objects) {
+ if (obj == null) throw new Exception("Data Row is Null");
+ }
+ }
+ catch (Throwable e)
+ {
+ datasource.getPage(page--);
+ throw new DataMissingException(e);
+ }
}
public boolean hasNext()
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java 2010-01-18
00:14:27 UTC (rev 1340)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java 2010-01-18
02:13:08 UTC (rev 1341)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.core;
+import org.exoplatform.commons.utils.DataMissingException;
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.bean.UIDataFeed;
@@ -75,7 +76,17 @@
UIVirtualList virtualList = event.getSource();
UIDataFeed dataFeed = virtualList.getDataFeed();
WebuiRequestContext rContext = event.getRequestContext();
- dataFeed.feedNext();
+ try
+ {
+ dataFeed.feedNext();
+ }
+ catch (DataMissingException e)
+ {
+ // Update parent of virtual list to refresh
+
event.getRequestContext().addUIComponentToUpdateByAjax(virtualList.getParent());
+ return;
+ }
+
if (!dataFeed.hasNext())
{
rContext.getJavascriptManager().addJavascript(
Show replies by date