deprecated function: application.showFormInDialog()

Hi,

is there a subsitution for the function
application.showFormInDialog()

As a result of a doubleclick on a listitem, I want to show a modal editform for this item in a seperate window! The opened form should be able to return a value to the calling form. Is this possible?
Thanks for your answers!

Hi ‘you’ :)

ShowFormInDialog (a.k.a a FID) is deprecated in Servoy 6 and replaced with the JSWindow class.
You can create a JSWindow instance via the application.createWindow() function.
Check out the JSWindow node under the application node in the Solution Explorer tree for all the functions and properties.

Hope this helps.

Hi,

thanks for your answer. It works successfully!
But now, I have another Problem:
Is there a subsitution for the function
application.closeForm()

Thanks for your answers again!

Hi,

You do all this in the JSWindow instance.
You have 2 options.

  1. hide the window to be (re)used later (so you don’t have to create a new JSWindow instance)
  2. destroy the window which will close it and remove it from memory. After this you can’t reuse this JSWindow instance anymore.

The .hide() and .destroy() functions are part of the JSWindow class (see the JSWindow node under the Application node in the Solution Explorer).

Hope this helps.

Hi ich,

You could choose to read the upgrade notes for 6, which details all this information:
http://wiki.servoy.com/display/DOCS/Upg … RuntimeAPI

Paul

Thanks for all you answers.
I now know a lot more … but I still have a problem. I designed my code like this:

var windowName = "xxWindow";
var formName = "xxForm";

application.createNewFormInstance("frm_message", formName);
var form = forms[formName];
var window = application.createWindow(windowName,JSWindow.MODAL_DIALOG);

form.controller.show(window);

[...]
// if the OK-button is pressed in the "form", the form variable "fv_retval" is set to "true"
// if the CANCEL-button is pressed in the "form", the form variable "fv_retval" is set to "false"
[...]

var retval = form.fv_retval;

if (retval){
  plugins.dialogs.showInfoDialog("Note", "Hello World", "OK");
}
[...]

If I run this code in the smart client, everything is fine. The programm is waiting at line “form.controller.show(window);” until the called form terminated by pushing “OK” or “CANCEL”. But whenn I run this code in a web client the programm is not waiting until the called form is closed!

Why? What can I do?
Are there any solutions?
Thanks a lot!
MIKE

See http://wiki.servoy.com/display/DOCS/Windows+and+Dialogs

Paul