### Eclipse Workspace Patch 1.0 #P mod_dialog Index: forms/dialogs_select.js =================================================================== --- forms/dialogs_select.js (revision 672) +++ forms/dialogs_select.js (working copy) @@ -21,7 +21,7 @@ } /** - * @param {Array} _aArguments + * @param {Array} _aArguments * @param {String} _sIconStyle * @param {Number} _nDialogWidth * @param {Number} _nDialogHeight @@ -42,7 +42,10 @@ controller.recreateUI(); elements.fldValue.setLocation(85, _nDialogHeight - 71); elements.fldValue.setSize(_nDialogWidth - 120, 22); - application.setValueListItems("dialogs_valuelist", _aArguments[1]); + + /** @type {Array} */ + var _values = _aArguments[1] + application.setValueListItems("dialogs_valuelist", _values); retVal = _aArguments[1][0]; callbackMethod = handleButtonAction; } Index: globals.js =================================================================== --- globals.js (revision 672) +++ globals.js (working copy) @@ -42,7 +42,7 @@ application.output('Marking form "' + formName + '" for cleanup', LOGGINGLEVEL.DEBUG); bluePrintStack.push(formName); } - + var terminator = (application.getApplicationType() == APPLICATION_TYPES.WEB_CLIENT ? new Continuation() : null); /** @@ -62,6 +62,7 @@ */ function newFormBluePrint(_sFormName, _sBaseFormName, _nWidth, _nHeight) { //Cleanup of previously used blueprints + /** @type {String} */ var formName; for (var i = 0; i < bluePrintStack.length; i++) { formName = bluePrintStack[i]; @@ -91,7 +92,7 @@ /** * @private * - * @param {String} _sFormName + * @param {String|RuntimeForm} _sFormName * @param {String} _sDlgType * @param {Array} _aArguments * @param {String} [_sIconStyle] @@ -99,17 +100,25 @@ * @return {String} */ function showDialog(_sFormName, _sDlgType, _aArguments, _sIconStyle) { + + /** @type {Object} */ var _aArgs = Array.prototype.slice.call(_aArguments), _nWidthPadding = 22, - i, dialogWindow; + dialogWindow; var _sUniqueName = _aArgs[8] || utils.stringReplace(application.getUUID().toString(), "-", ""); + if(_aArgs[0] instanceof RuntimeForm) _aArgs[0] = _aArgs[0].controller.getName() + if (_sDlgType == 'FIMD') { dialogWindow = application.createWindow("W_" + _sUniqueName, JSWindow.MODAL_DIALOG); dialogWindow.setLocation(_aArgs[1] | JSWindow.DEFAULT, _aArgs[2] || JSWindow.DEFAULT); if (_aArgs[5]) { dialogWindow.title = _aArgs[5]; } + else + { + dialogWindow.title = solutionModel.getForm(_aArgs[0]).titleText + } dialogWindow.resizable = (_aArgs[6] == null ? true : _aArgs[6]); dialogWindow.showTextToolbar(_aArgs[7] == null ? false : _aArgs[7]); forms[_aArgs[0]]['windowName'] = "W_" + _sUniqueName; @@ -152,7 +161,8 @@ switch (_sDlgType) { case 'input': - dialog.setupForm([_aArgs[1], i18n.getI18NMessage('servoy.button.ok'), i18n.getI18NMessage('servoy.button.cancel')], _sIconStyle, _aArgs[2], _nDialogWidth, _nDialogHeight + 30); + var _top = _aArgs[2] + dialog.setupForm([_aArgs[1], i18n.getI18NMessage('servoy.button.ok'), i18n.getI18NMessage('servoy.button.cancel')], _sIconStyle, _top, _nDialogWidth, _nDialogHeight + 30); break; case 'select': dialog.setupForm([_aArgs[1], _aArgs[2], i18n.getI18NMessage('servoy.button.ok'), i18n.getI18NMessage('servoy.button.cancel')], _sIconStyle, _nDialogWidth, _nDialogHeight + 30); Index: forms/dialogs_base.js =================================================================== --- forms/dialogs_base.js (revision 672) +++ forms/dialogs_base.js (working copy) @@ -94,7 +94,7 @@ */ function setupButtons(buttonArray, redraw, dialogWidth, dialogHeight) { var _oForm = solutionModel.getForm(controller.getName()), - _oMethod = solutionModel.getForm("dialogs_base").getFormMethod('onButtonAction'), + _oMethod = solutionModel.getForm("dialogs_base").getMethod('onButtonAction'), _oBtn, _nBtnMinWidth = 80, _nBtnWidth, // = _nBtnMinWidth, @@ -150,14 +150,17 @@ /** * Abstract method, to be overridden by childforms - * @param {Array} _aArguments + * @param {Array|Object} _aArguments * @param {String} _sIconStyle + * @param {Number} [_par3] + * @param {Number} [_par4] + * @param {Number} [_par5] * * @SuppressWarnings('wrongparameters') * * @properties={typeid:24,uuid:"74DE135A-C68C-4CA4-B889-E77359CD9700"} */ -function setupForm(_aArguments, _sIconStyle) { } +function setupForm(_aArguments, _sIconStyle, _par3, _par4, _par5) { } /** * Callback method for when form is shown. Index: forms/dialogs_message.js =================================================================== --- forms/dialogs_message.js (revision 672) +++ forms/dialogs_message.js (working copy) @@ -31,7 +31,9 @@ _oLabel = _oForm.newLabel("", 90, 15, _nDialogWidth - 100, 90); _oLabel.styleClass = 'dialogs_message'; _oLabel.verticalAlignment = SM_ALIGNMENT.TOP; - _oLabel.text = '' + utils.stringReplace(utils.stringReplace(utils.stringReplace(_aArguments[1], "\r\n", "
"), "\n", "
"), "\r", "
") + ''; + /** @type {String} */ + var _args1 = _aArguments[1] + _oLabel.text = '' + utils.stringReplace(utils.stringReplace(utils.stringReplace(_args1, "\r\n", "
"), "\n", "
"), "\r", "
") + ''; controller.recreateUI(); callbackMethod = handleButtonAction; Index: forms/dialogs_input.js =================================================================== --- forms/dialogs_input.js (revision 672) +++ forms/dialogs_input.js (working copy) @@ -40,7 +40,9 @@ _oLabel = _oForm.newLabel("", 90, 15, _nDialogWidth - 100, 90); _oLabel.styleClass = 'dialogs_message'; _oLabel.verticalAlignment = SM_ALIGNMENT.TOP; - _oLabel.text = '' + utils.stringReplace(utils.stringReplace(utils.stringReplace(_aArguments[0], "\r\n", "
"), "\n", "
"), "\r", "
") + ''; + /** @type {String} */ + var _args0 = _aArguments[0] + _oLabel.text = '' + utils.stringReplace(utils.stringReplace(utils.stringReplace(_args0, "\r\n", "
"), "\n", "
"), "\r", "
") + ''; controller.recreateUI(); elements.fldValue.setLocation(85, _nDialogHeight - 71); elements.fldValue.setSize(_nDialogWidth - 120, 20);