]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/Modal.js
Fix various problems with focus management
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-src / class / org / argeo / ria / components / Modal.js
index b69c1580f36b749be49051da2d3defbf32d3ee0a..e0895f48ccb84582b55ca94a1d48b5ed59b66883 100644 (file)
@@ -53,11 +53,18 @@ qx.Class.define("org.argeo.ria.components.Modal",
                        org.argeo.ria.components.ViewsManager.getInstance().getApplicationRoot().add(this);                     \r
                        this.show();\r
                },\r
+               /**\r
+                * Adds a close button bottom-center aligned to the popup\r
+                */\r
                addCloseButton : function(){\r
                        this.closeButton = new qx.ui.form.Button("Close");\r
                        this.closeButton.addListener("execute", this._closeAndDestroy, this);\r
                        this.add(this.closeButton, {edge:'south'});                     \r
                },\r
+               /**\r
+                * Adds two buttons bottom-center aligned (Ok and Cancel). \r
+                * Ok button has no listener by default, Cancel will close and destroy the popup.\r
+                */\r
                addOkCancel : function(){\r
                        var buttonPane = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, 'right'));\r
                        buttonPane.setAlignX("center");\r
@@ -68,6 +75,12 @@ qx.Class.define("org.argeo.ria.components.Modal",
                        buttonPane.add(this.cancelButton);\r
                        buttonPane.add(this.okButton);\r
                },\r
+               /**\r
+                * Adds a prompt form to the popup : a question, followed by a text input.\r
+                * @param questionString {String} The question to ask to the user \r
+                * @param validationCallback {Function} Callback to apply : takes the text input value as unique argument.\r
+                * @param callbackContext {Object} Context for the callback, optional.\r
+                */\r
                makePromptForm:function(questionString, validationCallback, callbackContext){\r
                        this.add(new qx.ui.basic.Label(questionString), {edge:'north'});\r
                        var textField = new qx.ui.form.TextField();\r
@@ -82,6 +95,9 @@ qx.Class.define("org.argeo.ria.components.Modal",
                                if(valid) this._closeAndDestroy();\r
                        }, this);\r
                },\r
+               /**\r
+                * Close this modal window and destroy it.\r
+                */\r
                _closeAndDestroy : function(){\r
                        this.hide();\r
                        this.destroy();                 \r