action.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. function debug(str) {
  9. if (topparent.getGlobal("dbg") == '1')
  10. alert(str);
  11. }
  12. function prepareFormDataString(viewAction) {
  13. var s;
  14. var bSrvMode = topparent.getGlobal("serverMode");
  15. var bDbg = topparent.getGlobal("dbg")
  16. if (bDbg == 1 && bSrvMode == 0)
  17. s = "viewAction=\n" + viewAction;
  18. else {
  19. s = "viewAction=" + CEncodingUtil.UrlEncode(viewAction);
  20. }
  21. var entries = topparent.getXtabFrame().hiddenFormEntries;
  22. for (var entry in entries) {
  23. if (bDbg == 1 && bSrvMode == 0)
  24. s += "\n\n";
  25. else
  26. s += "&";
  27. s += entry + "=";
  28. if (bDbg == 1 && bSrvMode == 0)
  29. s += ("\n" + entries[entry]);
  30. else
  31. s += CEncodingUtil.UrlEncode(entries[entry]);
  32. }
  33. return s;
  34. }
  35. function populateHiddenFormObject()
  36. {
  37. var hiddenForm = document.getElementById("fhidden");
  38. if (!hiddenForm)
  39. return;
  40. var inputs = hiddenForm.childNodes;
  41. for (var i = 0; i < inputs.length; i++)
  42. {
  43. var inputItem = inputs[i];
  44. if (inputItem.tagName.toLowerCase() == "input" && inputItem.type.toLowerCase() == "hidden")
  45. hiddenFormEntries[inputItem.name] = inputItem.value;
  46. }
  47. }