Author: truong.le
Date: 2009-12-03 21:33:50 -0500 (Thu, 03 Dec 2009)
New Revision: 919
Modified:
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java
portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl
Log:
GTNPORTAL-335: Can't select sub-page on menu item in special case
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-03
22:53:18 UTC (rev 918)
+++
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java 2009-12-04
02:33:50 UTC (rev 919)
@@ -82,6 +82,14 @@
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/portlet/web/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml 2009-12-03 22:53:18 UTC
(rev 918)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml 2009-12-04 02:33:50 UTC
(rev 919)
@@ -150,7 +150,12 @@
</portlet-info>
<portlet-preferences>
- <preference>
+ <preference>
+ <name>useAJAX</name>
+ <value>false</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
<name>template</name>
<value>system:/groovy/webui/core/UIBreadcumbs.gtmpl</value>
<read-only>false</read-only>
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-03
22:53:18 UTC (rev 918)
+++
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl 2009-12-04
02:33:50 UTC (rev 919)
@@ -1,8 +1,18 @@
<%
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();
def styleBread = uicomponent.getBreadcumbsStyle();
+
+ PortalRequestContext pcontext = Util.getPortalRequestContext();
+ def String portalURI = pcontext.getPortalURI();
+
+ UIPortletApplication breadcumbsPortlet = uicomponent.getParent();
+
+ def useAJAX = breadcumbsPortlet.isUseAjax();
%>
<div class="UIBreadcumbs">
@@ -13,8 +23,12 @@
<%if(list.size() > 0) {
String note = "LeftBlock";
for(i in 0 .. list.size()-1) {
- localPath = list.get(i);
- String actionLink = uicomponent.event("SelectPath", localPath.getId());
+ localPath = list.get(i);
+ String actionLink
+ if(useAJAX)
+ actionLink = uicomponent.event("SelectPath", localPath.getId());
+ else
+ actionLink = portalURI + localPath.getId();
if(i == list.size()-1) note = "Selected";
%>
<a href="<%=(localPath.getId() == null) ? "#" :
actionLink%>" class="$note">$localPath.label</a>