extend : qx.ui.window.Window,\r
\r
properties : {\r
+ /**\r
+ * The Spec to edit\r
+ */\r
batchEntrySpec : {\r
check : "org.argeo.slc.ria.execution.BatchEntrySpec"\r
}\r
* Triggered when the user clicks the "save" button. \r
*/\r
"save" : "qx.event.type.Event",\r
+ /**\r
+ * Triggered when any data is modified\r
+ */\r
"modified" : "qx.event.type.Event"\r
\r
},\r
/**\r
- * \r
- * @param caption {String} Title of the window\r
- * @param icon {String} Icon of the window\r
- * @param text {String} Default content of the window.\r
+ * Opens an editor with the given values. \r
+ * @param batchEntrySpec {org.argeo.slc.ria.execution.BatchEntrySpec} The initial spec to edit\r
*/\r
construct : function(batchEntrySpec){\r
var editorLabel = "Edit Specs for "+batchEntrySpec.getLabel();\r
},\r
\r
members : {\r
+ /**\r
+ * Builds the form from the BatchEntrySpec\r
+ */\r
createFormFromSpec : function(){\r
var values = this.getBatchEntrySpec().getValues();\r
for(var key in values){\r
}\r
}\r
},\r
- \r
+ /**\r
+ * Gather data from the form\r
+ */\r
saveFormToSpec : function(){\r
var values = this.getBatchEntrySpec().getValues();\r
for(var key in values){\r
* @param fieldLabel {String} Label of the field\r
* @param defaultValue {String} The default value\r
* @param choiceValues {Map} An map of values\r
+ * @param disabled {Boolean} The field is not writable\r
+ * @param subType {String} The type expected (string, integer, etc).\r
*/\r
_addFormInputText : function(formObject, fieldName, fieldLabel, defaultValue, disabled, subType, choiceValues){\r
var labelElement;\r
}, this);\r
this.cancelButton = new qx.ui.form.Button("Close");\r
this.cancelButton.addListener("execute", this._closeAndDestroy, this);\r
+\r
+ this.saveCloseButton = new qx.ui.form.Button("Save & Close");\r
+ this.saveCloseButton.addListener("execute", function(e){\r
+ this.fireEvent("save");\r
+ this._closeAndDestroy();\r
+ }, this);\r
+ \r
buttonPane.add(this.okButton);\r
buttonPane.add(this.cancelButton);\r
+ buttonPane.add(this.saveCloseButton);\r
},\r
/**\r
* Close this modal window and destroy it.\r