Author: phuong_vu
Date: 2010-09-29 03:02:40 -0400 (Wed, 29 Sep 2010)
New Revision: 4421
Modified:
portal/branches/branch-GTNPORTAL-1493/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
GTNPORTAL-1507 Loose UserPreference when drag and drop ToDo Gadget in Dashboard
Modified:
portal/branches/branch-GTNPORTAL-1493/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2010-09-29
04:00:36 UTC (rev 4420)
+++
portal/branches/branch-GTNPORTAL-1493/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2010-09-29
07:02:40 UTC (rev 4421)
@@ -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:
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js 2010-09-29
04:00:36 UTC (rev 4420)
+++
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js 2010-09-29
07:02:40 UTC (rev 4421)
@@ -43,12 +43,12 @@
href += "&op=SaveUserPref";
href += "&ajaxRequest=true";
href += "&userPref=" + prefs;
- ajaxAsyncGetRequest(href,true);
+ ajaxGet(href,true);
} else {
var params = [
{name : "userPref", value : prefs}
] ;
- ajaxAsyncGetRequest(eXo.env.server.createPortalURL(uiGadget.id.replace(/^content-/,""),
"SaveUserPref", true, params),true) ;
+ ajaxGet(eXo.env.server.createPortalURL(uiGadget.id.replace(/^content-/,""),
"SaveUserPref", true, params),true) ;
}
}
};
Modified:
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-29
04:00:36 UTC (rev 4420)
+++
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-29
07:02:40 UTC (rev 4421)
@@ -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:
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-09-29
04:00:36 UTC (rev 4420)
+++
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-09-29
07:02:40 UTC (rev 4421)
@@ -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));
Show replies by date