trigger script when user closes showFormInDialog

youre solution works fine after i did one fix:

youre show method should be attached onshow and not onload.
(because the global will never be set to 0 again)

Johan,

I know the sample solution works fine if you use the REAL Servoy globals; the method called ‘show’ was meant to be linked onShow but while I was testing I linked it on onLoad. The problem still remains (but has little to do with the topic of this discussion); globals that are NOT prefixed with ‘var’ worked fine up untill now but now I receive the error that the variable is not defined. So perhaps I need to start a new topic or file it as a bug?

Grtz
Jos

Jos, look at what I said about evaluating a value ‘==’ and executing it ‘=’.

That’s why you get the error that the value is not defined…

Johan,

I’ve included the sample solution again. If you run it and push the button on the first form you will immediately get the error ‘lClose is bnot defined’.

Grtz
Jos

Johan, Marcel,

I stand corrected, Servoy 101 :oops:
This is why CTRL-C / CTRL-V should never have been invented :wink:
Deep in my heart i’m still a Progress programmer where ‘==’ doesn’t exist…
If I change the onShow like Marcel suggested the sample solution works just fine. Now the only question remaining is why it will not work in my real solution. I did not make the same mistake here. Or is this perhaps due to the fact that my dialog is called by the onOpenscript (it’s a login dialog). The problem here still remains; the onHide method is called and returns false (I checked that by putting a message box before the return false) but nevertheless the dialog is closed…

Grtz
Jos

Johan, Marcel,

yep, it seems that the only dialog that doesn’t react to the return false is the login dialog(perhaps because there’s no window underneath it yet?); I’ve tried another one somewhere else in my solution and it works just fine, also with ‘fake’ globals :wink: . So Johan, the question really is; CAN this work in the onOpenscript of a solution or can’t it?

Grtz
Jos.

PS; thanks for paying attention to my stupidities so far

So only in a open solution script the onHide isn’t able to stop the dialog from closing?
I will try that out.

showing a formdialog in the solution startup is not fully supported in the current version.
I made a fix that it will call youre method at the right time in the next release.

i just notice that also this method: showRepImage is doing that.