Author: thomas.heute(a)jboss.com
Date: 2010-10-22 07:50:10 -0400 (Fri, 22 Oct 2010)
New Revision: 4768
Modified:
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
JBEPP-571: Lose UserPreference when drag and drop ToDo Gadget in Dashboard
Modified:
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2010-10-22
11:48:34 UTC (rev 4767)
+++
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2010-10-22
11:50:10 UTC (rev 4768)
@@ -175,11 +175,11 @@
if(inputList[i].value != null && inputList[i].value != "")
{
var tmp = inputList[i].value;
var numTask = tmp.substring(0, tmp.indexOf('.'));
- var contentTask = tmp.substring(tmp.indexOf('.'), tmp.length);
+ var contentTask = tmp.substring(tmp.indexOf('.') + 1, tmp.length);
if(parseInt(numTask) != parseInt(inputList[i].id)) {
numTask = inputList[i].id;
}
- inputList[i].value = numTask+contentTask;
+ inputList[i].value = numTask + "." + contentTask;
}
}
}
Modified:
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-10-22
11:48:34 UTC (rev 4767)
+++
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-10-22
11:50:10 UTC (rev 4768)
@@ -764,16 +764,26 @@
}
}
this.setUserPrefs(prefs);
- this.refresh();
};
+gadgets.IfrGadget.prototype.setUserPrefs = function(newUserPrefs) {
+ gadgets.IfrGadget.superClass_.setUserPrefs.call(this, newUserPrefs);
+ this.refresh();
+};
+
+gadgets.IfrGadget.prototype.setUserPref = function(name, value) {
+ gadgets.IfrGadget.superClass_.setUserPref.call(this, name, value);
+ this.refresh();
+};
+
gadgets.IfrGadget.prototype.handleCancelUserPrefs = function() {
this.hideUserPrefsDialog();
};
gadgets.IfrGadget.prototype.refresh = function() {
var iframeId = this.getIframeId();
- document.getElementById(iframeId).src = this.getIframeUrl();
+ if (document.getElementById(iframeId))
+ document.getElementById(iframeId).src = this.getIframeUrl();
};
Modified:
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-10-22
11:48:34 UTC (rev 4767)
+++
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-10-22
11:50:10 UTC (rev 4768)
@@ -376,12 +376,13 @@
public void execute(Event<UIGadget> event) throws Exception
{
UIGadget uiGadget = event.getSource();
-
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+
//
try{
uiGadget.addUserPref(event.getRequestContext().getRequestParameter("userPref"));
- } catch(Exception e){
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ Util.getPortalRequestContext().setFullRender(true);
+ } catch(Exception e){
UIPortletApplication uiPortlet =
uiGadget.getAncestorOfType(UIPortletApplication.class);
context.addUIComponentToUpdateByAjax(uiPortlet);
throw new MessageException(new
ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null,
ApplicationMessage.ERROR));