explain.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 Explain pane of
  9. // PowerPlay Studio.
  10. // The functions handle any minor browser differences.
  11. function init(){
  12. topparent.openActionPane();
  13. ContextMenu.initialize(true,false);
  14. var rowSelections = topparent.getXtabFrame().getSelected("r");
  15. var colSelections = topparent.getXtabFrame().getSelected("c");
  16. //update "EXPL" parameter
  17. var updateNotification = '1';
  18. if (rowSelections.length == 1){
  19. if (colSelections.length == 1 || !colSelections.length)
  20. {
  21. updateNotification += '\tr' + rowSelections[0].getAttribute("nodeId");
  22. }
  23. }
  24. if (colSelections.length == 1)
  25. updateNotification += '\tc' + colSelections[0].getAttribute("nodeId");
  26. //update hidden form entry
  27. var explFormEntry = topparent.getXtabFrame().document.fhidden.EXPL;
  28. explFormEntry.value = updateNotification;
  29. }
  30. function refresh() {
  31. resetExplainDialog()
  32. }
  33. function resetExplainDialog() {
  34. var ACT_PANE_EXPLAIN = 4;
  35. var rowSelections = topparent.getXtabFrame().getSelected("r");
  36. var colSelections = topparent.getXtabFrame().getSelected("c");
  37. var action = "ME";
  38. var hiddenForm = topparent.getXtabFrame().fh;
  39. hiddenForm.EXPL.value = '1';
  40. if (rowSelections.length == 1){
  41. if (colSelections.length == 1 || !colSelections.length)
  42. action += ":" + "r" + + rowSelections[0].getAttribute("nodeId");
  43. }
  44. if (colSelections.length == 1){
  45. if (!rowSelections.length)
  46. action += ":" + "c" + colSelections[0].getAttribute("nodeId");
  47. if(rowSelections.length == 1)
  48. hiddenForm.EXPL.value = '1\tc' + colSelections[0].getAttribute("nodeId");
  49. }
  50. hiddenForm.CO.value=action;
  51. hiddenForm.ACTPANE.value = ACT_PANE_EXPLAIN;
  52. hiddenForm.CNCT.value = 19;
  53. hiddenForm.target = "ActionPane";
  54. topparent.getXtabFrame().FTok=false;
  55. hiddenForm.RA.value = 999;
  56. topparent.getXtabFrame().parseAndSubmit(hiddenForm);
  57. }