Page 1 of 1

showFormInDialog

PostPosted: Thu Jun 18, 2009 9:42 pm
by srowe
I have a web application that I am using showFormInDialog for a modal form.

The form that is shown has three buttons, Continue, Cancel and Exit.

I use a global variable that I set to 1 before the ShowFormInDialog.

The form shows, user clicks the Continue Button. I have a function on the button that sets the value of gvOK to 0;

When the application returns to the calling function, the value of gvOK is still set at 1.


Any suggestions on how to get the return value from showFormInDialog?


Thanks!

Servoy

Version: 4.1.3 - build 672

Re: showFormInDialog

PostPosted: Fri Jun 19, 2009 10:00 am
by Andrei Costescu
There is a difference in web-client - the code in the method that opens the modal form continues to run after the form in dialog is open (due to implementation constraints), as opposed to smart client where the code will continue to run only after the dialog is closed. This has been discussed a lot (I think on the forum as well so you should find other topics about this) - the bottom line is that in web-client you can do the following:

  • initial code:
    Code: Select all
    function someFunction() {
        [... code before open dialog]
        application.showFormInDialog(...);
        [... code after you would expect dialog is closed]
    }
    function dialogActionThatClosesTheDialog() {
        [... change some global for example and close dialog]
    }
  • new web-client compatible code:
    Code: Select all
    function someFunction() {
        [... code before open dialog]
        application.showFormInDialog(...);
    }
    function someFunctionContinued() {
        [... code after you would expect dialog is closed]
    }
    function dialogActionThatClosesTheDialog() {
        [... change some global for example and close dialog]
        someFunctionContinued() ;
    }

Re: showFormInDialog

PostPosted: Fri Jun 19, 2009 10:24 am
by Hans Nieuwenhuis
Hi,

Paul Bakker also discussed this issue in his Webinair on Javascript.

I think this webinair has been recorded.

Regards,

Hans

Re: showFormInDialog

PostPosted: Fri Jun 19, 2009 6:05 pm
by srowe
got it to work.


Thanks for the direction.....