suppressoptions_gen.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Licensed Materials - Property of IBM
  2. //
  3. // IBM Cognos Products: pps
  4. //
  5. // (C) Copyright IBM Corp. 2005, 2017
  6. //
  7. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. // This forms the javascript functions used for the Suppression options
  9. // action pane for PowerPlay Studio - generic UI.
  10. // The functions handle any minor browser differences.
  11. var SUPPRESS_ZERO_VALUES = 1;
  12. var SUPPRESS_DIVISION_BY_ZERO = 2;
  13. var SUPPRESS_MISSING_VALUES = 4;
  14. var SUPPRESS_OVERFLOW_VALUES = 8;
  15. var isSplitPane = parent.parent.getWindow().name == "FX1" ;
  16. function getParentFX() {
  17. if (isSplitPane) {
  18. return parent.FX2;
  19. } else {
  20. return parent.FX;
  21. }
  22. }
  23. function closeit() {
  24. getParentFX().doit('MD');
  25. }
  26. function onOK() {
  27. applySuppressOptions(true)
  28. }
  29. function applySuppressOptions(forceClose)
  30. {
  31. var optionsValue = 0;
  32. // Zero values - 1
  33. // Division by zero - 2
  34. // Missing values - 4
  35. // Overflow values - 8
  36. var suppressZeroValues = document.getElementById("zero");
  37. if( suppressZeroValues.checked )
  38. optionsValue += SUPPRESS_ZERO_VALUES;
  39. var suppressDivisionByZero = document.getElementById("dividebyzero");
  40. if( suppressDivisionByZero.checked )
  41. optionsValue += SUPPRESS_DIVISION_BY_ZERO;
  42. var suppressMissingValues = document.getElementById("missing");
  43. if( suppressMissingValues.checked )
  44. optionsValue += SUPPRESS_MISSING_VALUES;
  45. var suppressOverflowValues = document.getElementById("overflow");
  46. if( suppressOverflowValues.checked )
  47. optionsValue += SUPPRESS_OVERFLOW_VALUES;
  48. command = "UO:" + optionsValue;
  49. if( forceClose )
  50. command += "\t\tMD";
  51. getParentFX().doit( command );
  52. }