Author: truong.le
Date: 2009-12-03 23:57:46 -0500 (Thu, 03 Dec 2009)
New Revision: 920
Modified:
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java
Log:
GTNPORTAL-335: Can't select sub-page on menu item in special case
re-fix this issue
Modified:
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java
===================================================================
---
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java 2009-12-04
02:33:50 UTC (rev 919)
+++
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java 2009-12-04
04:57:46 UTC (rev 920)
@@ -81,15 +81,7 @@
}
UIBreadcumbs uiBreadCumbs = getChild(UIBreadcumbs.class);
uiBreadCumbs.setPath(paths);
- }
-
- public boolean isUseAjax()
- {
- PortletRequestContext context =
(PortletRequestContext)WebuiRequestContext.getCurrentInstance();
- PortletRequest prequest = context.getRequest();
- PortletPreferences prefers = prequest.getPreferences();
- return Boolean.valueOf(prefers.getValue("useAJAX", "true"));
- }
+ }
@Override
public void renderChildren() throws Exception
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl 2009-12-04
02:33:50 UTC (rev 919)
+++
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl 2009-12-04
04:57:46 UTC (rev 920)
@@ -1,7 +1,6 @@
<%
import java.util.List;
import org.exoplatform.portal.webui.util.Util;
- import org.exoplatform.webui.core.UIPortletApplication;
import org.exoplatform.portal.application.PortalRequestContext;
List list = uicomponent.getPath();
@@ -9,10 +8,8 @@
PortalRequestContext pcontext = Util.getPortalRequestContext();
def String portalURI = pcontext.getPortalURI();
-
- UIPortletApplication breadcumbsPortlet = uicomponent.getParent();
-
- def useAJAX = breadcumbsPortlet.isUseAjax();
+
+ def useAJAX = uicomponent.isUseAjax();
%>
<div class="UIBreadcumbs">
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java 2009-12-04
02:33:50 UTC (rev 919)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java 2009-12-04
04:57:46 UTC (rev 920)
@@ -19,6 +19,8 @@
package org.exoplatform.webui.core;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIBreadcumbs.SelectPathActionListener;
@@ -29,6 +31,9 @@
import java.util.ArrayList;
import java.util.List;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+
/**
* Represents a breadcrumbs component.
*
@@ -100,6 +105,18 @@
{
styleBread = style;
}
+
+ public boolean isUseAjax()
+ {
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ if(context instanceof PortletRequestContext)
+ {
+ PortletRequest prequest = ((PortletRequestContext)context).getRequest();
+ PortletPreferences prefers = prequest.getPreferences();
+ return Boolean.valueOf(prefers.getValue("useAJAX", "true"));
+ }
+ return true;
+ }
static public class SelectPathActionListener extends
EventListener<UIBreadcumbs>
{
Show replies by date