ResizeChartAction.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2013
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. function ResizeChartAction() {
  13. this.m_width = 0;
  14. this.m_height = 0;
  15. this.m_actionContext = null;
  16. }
  17. ResizeChartAction.prototype = new CognosViewerAction();
  18. ResizeChartAction.prototype.setRequestParms = function(requestParams) {
  19. if(requestParams && requestParams.resize) {
  20. this.m_width = requestParams.resize.w;
  21. this.m_height = requestParams.resize.h;
  22. this.m_actionContext = requestParams.resize.actionContext;
  23. }
  24. };
  25. ResizeChartAction.prototype.execute = function() {
  26. var oCV = this.getCognosViewer();
  27. var oReq = new ViewerDispatcherEntry(oCV);
  28. oReq.addFormField("ui.action", "modifyReport");
  29. if (!this.m_actionContext) {
  30. this.m_actionContext = "<reportActions><ChangeDataContainerSize><idSelectAll/><height>" + this.m_height + "</height><width>" + this.m_width + "</width></ChangeDataContainerSize></reportActions>";
  31. }
  32. oReq.addFormField("cv.actionContext", this.m_actionContext);
  33. oReq.addFormField("keepIterators", "true");
  34. oReq.addFormField("cv.reuseConversation", "true");
  35. oReq.addFormField("reuseResults", "true");
  36. oReq.addDefinedFormField("ui.spec", oCV.envParams["ui.spec"]);
  37. oReq.addDefinedFormField("modelPath", oCV.getModelPath());
  38. oReq.addDefinedFormField("packageBase", oCV.envParams["packageBase"]);
  39. oReq.setCanBeQueued(true);
  40. oCV.dispatchRequest(oReq);
  41. }