[gatein-commits] gatein SVN: r601 - in portal/trunk: web/eXoResources/src/main/webapp/javascript/eXo/webui and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Nov 16 00:06:42 EST 2009


Author: tan_pham_dinh
Date: 2009-11-16 00:06:41 -0500 (Mon, 16 Nov 2009)
New Revision: 601

Modified:
   portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
Log:
GTNPORTAL-103: Error when change title of dashboard tab to null

Modified: portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
--- portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java	2009-11-16 03:48:24 UTC (rev 600)
+++ portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java	2009-11-16 05:06:41 UTC (rev 601)
@@ -38,7 +38,6 @@
 import org.exoplatform.webui.core.UIContainer;
 import org.exoplatform.webui.event.Event;
 import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.exception.MessageException;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -212,6 +211,10 @@
 
    private boolean validateName(String label)
    {
+      if (label == null || label.length() < 1)
+      {
+         return false;
+      }
       label = label.trim();
       if (Character.isDigit(label.charAt(0)) || label.charAt(0) == '-')
       {

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js	2009-11-16 03:48:24 UTC (rev 600)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js	2009-11-16 05:06:41 UTC (rev 601)
@@ -31,7 +31,7 @@
 		if(keyNum == 13){
 			var inputElement = eXo.core.Browser.getEventSource(e);
 			var newTabLabel = inputElement.value;
-			if(newTabLabel.length < 1){
+			if(!newTabLabel || newTabLabel.length < 1){
 				return;
 			}
 			var DOMUtil = eXo.core.DOMUtil;
@@ -53,15 +53,10 @@
 			href += "&objectId=" + nodeIndex;
 			href += "&newTabLabel=" + encodeURIComponent(newTabLabel);
 			window.location = href;
-			return;			
 		}
 		//If user presses on the ESCAPE key, then reset the span element on the tab
 		else if(keyNum == 27){
 			var inputElement = eXo.core.Browser.getEventSource(e);
-//			var spanElement = document.createElement("span");
-//			spanElement.ondblclick = "#"; //TODO: Set the callback on this property
-//			spanElement.innerHTML = inputElement.name;
-//			inputElement.parentNode.replaceChild(spanElement, inputElement);
 			if(eXo.webui.UITabbedDashboard.backupElement) {
  				inputElement.parentNode.replaceChild(eXo.webui.UITabbedDashboard.backupElement, inputElement);
  				eXo.webui.UITabbedDashboard.backupElement = null;
@@ -102,6 +97,7 @@
 		if(keyNum == 13){
 			var inputElement = eXo.core.Browser.getEventSource(e);
 			var newTabLabel = inputElement.value;
+			if(!newTabLabel || newTabLabel.length < 1) return;
 			
 			//Send request to server to change node name
 			var href = eXo.env.server.portalBaseURL + "?portal:componentId=" + inputElement.id;



More information about the gatein-commits mailing list