DelayedLoadingContext.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2014
  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 DelayedLoadingContext( id ){
  13. this.widgetid = id;
  14. this.m_promptValues = null;
  15. }
  16. DelayedLoadingContext.prototype.setPromptValues = function( promptValues ) {
  17. if (promptValues === null) {
  18. this.m_promptValues = null;
  19. return;
  20. }
  21. if (!this.m_promptValues) {
  22. this.m_promptValues = {};
  23. }
  24. // The m_promptValues object will have the parameter name as a property and
  25. // it's value is the parameter value. This way if a parameter is updated multiple times
  26. // we'll only keep track of the latest value.
  27. // COGCQ00854465
  28. applyJSONProperties(this.m_promptValues, promptValues);
  29. };
  30. DelayedLoadingContext.prototype.getPromptValues = function() {
  31. return this.m_promptValues;
  32. };
  33. DelayedLoadingContext.prototype.setForceRunReport = function( forceRunReport ) {
  34. this.m_forceRunReport = forceRunReport;
  35. };
  36. DelayedLoadingContext.prototype.getForceRunReport = function() {
  37. return this.m_forceRunReport;
  38. };
  39. DelayedLoadingContext.prototype.isEmpty = function() {
  40. return !(this.m_promptValues || this.m_forceRunReport);
  41. };
  42. DelayedLoadingContext.prototype.reset = function() {
  43. delete(this.m_promptValues);
  44. this.m_promptValues = null;
  45. this.m_forceRunReport = false;
  46. delete( this._cascadingPromptParamsToClear );
  47. };
  48. DelayedLoadingContext.prototype.setCascadingPromptParamsToClear = function( cascadingPromptParamsToClear ) {
  49. this._cascadingPromptParamsToClear = cascadingPromptParamsToClear;
  50. };
  51. DelayedLoadingContext.prototype.getCascadingPromptParamsToClear = function() {
  52. return this._cascadingPromptParamsToClear;
  53. };