Author: phuong_vu
Date: 2011-11-03 10:45:59 -0400 (Thu, 03 Nov 2011)
New Revision: 7958
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputIconSelector.java
Log:
GTNPORTAL-2250 Sites Management porlet flickers when editing node's
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2011-11-03
14:03:18 UTC (rev 7957)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2011-11-03
14:45:59 UTC (rev 7958)
@@ -78,7 +78,8 @@
@EventConfig(listeners = UIPageNodeForm.SwitchPublicationDateActionListener.class,
phase = Phase.DECODE),
@EventConfig(listeners = UIPageNodeForm.SwitchVisibleActionListener.class, phase =
Phase.DECODE),
@EventConfig(listeners = UIPageNodeForm.ClearPageActionListener.class, phase =
Phase.DECODE),
- @EventConfig(listeners = UIPageNodeForm.CreatePageActionListener.class, phase =
Phase.DECODE)}),
+ @EventConfig(listeners = UIPageNodeForm.CreatePageActionListener.class, phase =
Phase.DECODE),
+ @EventConfig(listeners = UIPageNodeForm.SelectTabActionListener.class, phase =
Phase.DECODE)}),
@ComponentConfig(type = UIPopupWindow.class, template =
"system:/groovy/webui/core/UIPopupWindow.gtmpl",
events = @EventConfig(listeners =
UIGroupNavigationManagement.CloseActionListener.class, name = "ClosePopup"))})
public class UIGroupNavigationManagement extends UIContainer
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java 2011-11-03
14:03:18 UTC (rev 7957)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java 2011-11-03
14:45:59 UTC (rev 7958)
@@ -19,6 +19,20 @@
package org.exoplatform.navigation.webui.component;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.navigation.webui.TreeNode;
@@ -27,7 +41,6 @@
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.Described;
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.Visibility;
@@ -51,7 +64,6 @@
import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.exception.MessageException;
-import org.exoplatform.webui.form.UIFormCheckBoxInput;
import org.exoplatform.webui.form.UIFormDateTimeInput;
import org.exoplatform.webui.form.UIFormInputBase;
import org.exoplatform.webui.form.UIFormInputIconSelector;
@@ -59,26 +71,13 @@
import org.exoplatform.webui.form.UIFormSelectBox;
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.UIFormTabPane;
+import org.exoplatform.webui.form.input.UICheckBoxInput;
import org.exoplatform.webui.form.validator.DateTimeValidator;
import org.exoplatform.webui.form.validator.IdentifierValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
import org.exoplatform.webui.form.validator.Validator;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
/**
* Author : Dang Van Minh, Pham Tuan minhdv81(a)yahoo.com Jun 14, 2006
*/
@@ -121,13 +120,12 @@
public UIPageNodeForm() throws Exception
{
super("UIPageNodeForm");
+ UIFormInputSet uiSettingSet = new UIFormInputSet("PageNodeSetting");
+ UICheckBoxInput uiDateInputCheck =
+ new UICheckBoxInput(SHOW_PUBLICATION_DATE, null, false);
+ UICheckBoxInput uiVisibleCheck = new UICheckBoxInput(VISIBLE, null, true);
+ UICheckBoxInput uiSwitchLabelMode = new UICheckBoxInput(SWITCH_MODE, null, true);
- UIFormInputSet uiSettingSet = new UIFormInputSet("PageNodeSetting");
- UIFormCheckBoxInput<Boolean> uiDateInputCheck =
- new UIFormCheckBoxInput<Boolean>(SHOW_PUBLICATION_DATE, null, false);
- UIFormCheckBoxInput<Boolean> uiVisibleCheck = new
UIFormCheckBoxInput<Boolean>(VISIBLE, null, true);
- UIFormCheckBoxInput<Boolean> uiSwitchLabelMode = new
UIFormCheckBoxInput<Boolean>(SWITCH_MODE, null, true);
-
uiDateInputCheck.setOnChange("SwitchPublicationDate");
uiVisibleCheck.setOnChange("SwitchVisible");
uiSwitchLabelMode.setOnChange(SWITCH_MODE_ONCHANGE);
@@ -307,8 +305,8 @@
{
Visibility visibility = pageNode.getVisibility();
boolean isVisible = visibility == null || EnumSet.of(Visibility.DISPLAYED,
Visibility.TEMPORAL).contains(visibility);
- getUIFormCheckBoxInput(VISIBLE).setChecked(isVisible);
-
getUIFormCheckBoxInput(SHOW_PUBLICATION_DATE).setChecked(Visibility.TEMPORAL.equals(visibility));
+ getUICheckBoxInput(VISIBLE).setChecked(isVisible);
+
getUICheckBoxInput(SHOW_PUBLICATION_DATE).setChecked(Visibility.TEMPORAL.equals(visibility));
setShowCheckPublicationDate(isVisible);
Calendar cal = Calendar.getInstance();
if (pageNode.getStartPublicationTime() != -1)
@@ -333,7 +331,7 @@
isExtendedMode = false;
}
- getUIFormCheckBoxInput(SWITCH_MODE).setChecked(isExtendedMode);
+ getUICheckBoxInput(SWITCH_MODE).setChecked(isExtendedMode);
this.switchLabelMode(isExtendedMode);
}
@@ -345,9 +343,9 @@
if (node.getVisibility() != Visibility.SYSTEM)
{
Visibility visibility;
- if (getUIFormCheckBoxInput(VISIBLE).isChecked())
+ if (getUICheckBoxInput(VISIBLE).isChecked())
{
- UIFormCheckBoxInput showPubDate =
getUIFormCheckBoxInput(SHOW_PUBLICATION_DATE);
+ UICheckBoxInput showPubDate = getUICheckBoxInput(SHOW_PUBLICATION_DATE);
visibility = showPubDate.isChecked() ? Visibility.TEMPORAL :
Visibility.DISPLAYED;
}
else
@@ -393,7 +391,7 @@
node.setI18nizedLabels(labels);
- if
(getUIFormCheckBoxInput(SWITCH_MODE).getValue().toString().equals("true"))
+ if
(getUICheckBoxInput(SWITCH_MODE).getValue().toString().equals("true"))
node.setLabel(null);
else if (node.getLabel() == null)
node.setLabel(node.getName());
@@ -401,8 +399,8 @@
public void setShowCheckPublicationDate(boolean show)
{
- getUIFormCheckBoxInput(VISIBLE).setChecked(show);
- UIFormCheckBoxInput<Boolean> uiForm =
getUIFormCheckBoxInput(SHOW_PUBLICATION_DATE);
+ getUICheckBoxInput(VISIBLE).setChecked(show);
+ UICheckBoxInput uiForm = getUICheckBoxInput(SHOW_PUBLICATION_DATE);
uiForm.setRendered(show);
setShowPublicationDate(show && uiForm.isChecked());
}
@@ -466,7 +464,7 @@
TreeNode pageNode = uiPageNodeForm.getPageNode();
if (pageNode == null || (pageNode.getVisibility() != Visibility.SYSTEM
&&
- uiPageNodeForm.getUIFormCheckBoxInput(SHOW_PUBLICATION_DATE).isChecked()))
+ uiPageNodeForm.getUICheckBoxInput(SHOW_PUBLICATION_DATE).isChecked()))
{
Calendar currentCalendar = Calendar.getInstance();
currentCalendar.set(currentCalendar.get(Calendar.YEAR),
currentCalendar.get(Calendar.MONTH), currentCalendar.get(Calendar.DAY_OF_MONTH), 0, 0,
0);
@@ -572,6 +570,7 @@
uiForm.setSelectedLocale(languageSelection.getValue());
label.setValue(uiForm.getLabelOnLocale(uiForm.getSelectedLocale()));
+ event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
}
}
@@ -590,7 +589,6 @@
cachedLabels.put(locale, new Described.State(label, null));
}
-
public void setSelectedLocale(String selectedLocale)
{
this.selectedLocale = selectedLocale;
@@ -606,7 +604,7 @@
public void execute(Event<UIPageNodeForm> event) throws Exception
{
UIPageNodeForm uiForm = event.getSource();
- boolean isCheck =
uiForm.getUIFormCheckBoxInput(SHOW_PUBLICATION_DATE).isChecked();
+ boolean isCheck = uiForm.getUICheckBoxInput(SHOW_PUBLICATION_DATE).isChecked();
uiForm.setShowPublicationDate(isCheck);
event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
}
@@ -618,7 +616,7 @@
public void execute(Event<UIPageNodeForm> event) throws Exception
{
UIPageNodeForm uiForm = event.getSource();
- boolean isCheck = uiForm.getUIFormCheckBoxInput(VISIBLE).isChecked();
+ boolean isCheck = uiForm.getUICheckBoxInput(VISIBLE).isChecked();
uiForm.setShowCheckPublicationDate(isCheck);
event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
}
@@ -630,7 +628,7 @@
public void execute(Event<UIPageNodeForm> event) throws Exception
{
UIPageNodeForm uiForm = event.getSource();
- boolean isExtendedMode =
uiForm.getUIFormCheckBoxInput(SWITCH_MODE).isChecked();
+ boolean isExtendedMode = uiForm.getUICheckBoxInput(SWITCH_MODE).isChecked();
uiForm.switchLabelMode(isExtendedMode);
event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
}
@@ -654,7 +652,6 @@
UIPageNodeForm uiForm = event.getSource();
UIPageSelector pageSelector =
uiForm.findFirstComponentOfType(UIPageSelector.class);
- PortalRequestContext pcontext = Util.getPortalRequestContext();
UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
UIFormInputSet uiInputSet = pageSelector.getChild(UIFormInputSet.class);
@@ -735,11 +732,21 @@
uiPortalApp.addMessage(new
ApplicationMessage("UIPageForm.msg.sameName", null));
return;
}
-
pageSelector.setPage(page);
+ event.getRequestContext().addUIComponentToUpdateByAjax(pageSelector);
}
}
+ static public class SelectTabActionListener extends
UIFormTabPane.SelectTabActionListener
+ {
+ public void execute(Event<UIFormTabPane> event) throws Exception
+ {
+ super.execute(event);
+ PortalRequestContext pcontext = Util.getPortalRequestContext();
+ pcontext.setResponseComplete(true);
+ }
+ }
+
private void switchLabelMode(boolean isExtendedMode)
{
getUIStringInput(LABEL).setRendered(!isExtendedMode);
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2011-11-03
14:03:18 UTC (rev 7957)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2011-11-03
14:45:59 UTC (rev 7958)
@@ -72,13 +72,14 @@
@EventConfig(listeners = UISiteManagement.DeletePortalActionListener.class, confirm
= "UIPortalBrowser.deletePortal")}),
@ComponentConfig(type = UIPageNodeForm.class, lifecycle = UIFormLifecycle.class,
template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@EventConfig(listeners = UIPageNodeForm.SaveActionListener.class),
- @EventConfig(listeners = UIPageNodeForm.ChangeLanguageActionListener.class, phase =
Phase.DECODE),
+ @EventConfig(listeners = UIPageNodeForm.ChangeLanguageActionListener.class, phase =
Phase.DECODE),
@EventConfig(listeners = UISiteManagement.BackActionListener.class, phase =
Phase.DECODE),
@EventConfig(listeners = UIPageNodeForm.SwitchLabelModeActionListener.class, phase
= Phase.DECODE),
@EventConfig(listeners = UIPageNodeForm.SwitchPublicationDateActionListener.class,
phase = Phase.DECODE),
@EventConfig(listeners = UIPageNodeForm.SwitchVisibleActionListener.class, phase =
Phase.DECODE),
@EventConfig(listeners = UIPageNodeForm.ClearPageActionListener.class, phase =
Phase.DECODE),
- @EventConfig(listeners = UIPageNodeForm.CreatePageActionListener.class, phase =
Phase.DECODE)}),
+ @EventConfig(listeners = UIPageNodeForm.CreatePageActionListener.class, phase =
Phase.DECODE),
+ @EventConfig(listeners = UIPageNodeForm.SelectTabActionListener.class, phase =
Phase.DECODE)}),
@ComponentConfig(type = UIPopupWindow.class, template =
"system:/groovy/webui/core/UIPopupWindow.gtmpl",
events = @EventConfig(listeners = UISiteManagement.CloseActionListener.class, name
= "ClosePopup"))})
public class UISiteManagement extends UIContainer
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputIconSelector.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputIconSelector.java 2011-11-03
14:03:18 UTC (rev 7957)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputIconSelector.java 2011-11-03
14:45:59 UTC (rev 7958)
@@ -190,7 +190,6 @@
return selectedIcon;
}
- @SuppressWarnings("unused")
public void decode(Object input, WebuiRequestContext context) throws Exception
{
if (input == null || String.valueOf(input).length() < 1)
@@ -205,7 +204,6 @@
UIFormInputIconSelector uiForm = event.getSource();
String paramName = event.getRequestContext().getRequestParameter(OBJECTID);
uiForm.setValues(paramName);
- //uiForm.setRenderSibbling(UIFormInputIconSelector.class);
}
}
@@ -223,10 +221,9 @@
uiIconSelector.setSelectedIconSet(set);
}
}
- //uiIconSelector.setRenderSibbling(UIFormInputIconSelector.class) ;
UIForm uiForm = uiIconSelector.getAncestorOfType(UIForm.class);
- event.getRequestContext().addUIComponentToUpdateByAjax(uiForm.getParent());
+ event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
}
}
@@ -246,21 +243,18 @@
uiIconSelector.setSelectedIconSet(set);
}
}
- //uiIconSelector.setRenderSibbling(UIFormInputIconSelector.class) ;
UIForm uiForm = uiIconSelector.getAncestorOfType(UIForm.class);
- event.getRequestContext().addUIComponentToUpdateByAjax(uiForm.getParent());
+ event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
return;
}
uiIconSelector.setSelectedIcon(iconName);
- //uiIconSelector.setRenderSibbling(UIFormInputIconSelector.class) ;
UIForm uiForm = uiIconSelector.getAncestorOfType(UIForm.class);
- event.getRequestContext().addUIComponentToUpdateByAjax(uiForm.getParent());
+ event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
}
}
- //TODO Rename this to CategoryIconSet
static public class CategoryIcon
{