Servoy 6 application.closeFormDialog(); replacement?

Hi all,

application.closeFormDialog();

is deprecated in Servoy 6, but what is the replacement. I have been googling and can’t seem to find the answer…

Well you could make your own method, something like this:

/**
 *	@param {JSEvent} _event
 * 
 *
 * @properties={typeid:24,uuid:"EEBCA54A-71AE-44E5-A33D-695B625216C2"}
 */
function svy_mod_closeForm(_event)
{
	var _formname =  _event.getFormName()
	var _context = forms[_formname].controller.getFormContext()
	/** @type {String} */
	var _window = _context.getValue(1,1)
	if(application.getWindow(_window))
	{
		var _windowObject = application.getWindow(_window)
		_windowObject.hide()
		
	}
}

Thanks!

Is it better to ‘hide’ the window rather than ‘destroy’ it?

if you know you are going to reuse it, you can just hide it
If you know you are constantly creating new dialogs with different names, do destroy it