ClipboardDialog.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2012
  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. dojo.provide("viewer.dialogs.ClipboardDialog");
  13. dojo.require("bux.dialogs.BaseCustomContentDialog");
  14. dojo.require("bux.layout.TableContainer");
  15. dojo.require("dijit.form.Textarea");
  16. dojo.require("dijit.form.Button");
  17. dojo.declare("viewer.dialogs.ClipboardDialog", bux.dialogs.BaseCustomContentDialog, {
  18. sTitle: null,
  19. okHandler: null, /*Function?*/
  20. cancelHandler:null, /*Function?*/
  21. startup: function() {
  22. this.updateTitle(this.sTitle);
  23. this.inherited(arguments);
  24. var tableContainer = new bux.layout.TableContainer({
  25. // TODO remove this class
  26. classname: "bux-InformationDialog"
  27. },this.contentContainer);
  28. var cell = null, row = null;
  29. this._textField = new dijit.form.SimpleTextarea({
  30. required:true,
  31. rows: 10,
  32. cols: 50,
  33. style: 'width:auto'});
  34. row = new bux.layout.TableContainerRow({
  35. parentContainer: tableContainer
  36. });
  37. cell = new bux.layout.TableContainerCell({
  38. classname: "bux-dialog-field",
  39. parentContainer: row
  40. });
  41. cell.addContent(this._textField.domNode);
  42. },
  43. onOK : function()
  44. {
  45. if (this._textField.state != "Error")
  46. {
  47. this.inherited(arguments);
  48. this.okHandler(this._textField.get("value"));
  49. this.hide();
  50. }
  51. }
  52. });