Simplicty and flexibility!


Opening Form Multiple Times


Started by Bert
Search
You will need to Sign In to be able to add or comment on the forum!

Opening Form Multiple Times

After updating to 2457 it is now possible to open a form multiple times.

I have tried to put DocumentCloseName("myForm")+ in front but that doesn't work.

Is it possible somewhere to tell DFW that a form only can be opened once (as it Always was) ?


Written by Bert 08/09/16 at 15:20:37 Dataease [{8}]FIVE

Re:Opening Form Multiple Times

Download Sample


Hi Bert.

Yes, this was change quite some time ago. It was completely illogical that you shouldn't be able to open a form more than once. 

There is now multiple cases where you use a form to take on different roles and even control the open logic for auto searching etc.

To blatantly stop users to do things is not the way of DataEase these days, but we obviously allow you to control your behaviour.

You can simply check if the form is already open and then activate it instead of opening it.

GetCurrent("IsDocOpen")

IsDocOpen [, DocumentName]

Will return YES if DocumentName is open. No if it is not open. If not open, you can open it with DocumentOpen() if it is open, you can switch to it with SetCurrent("ActiveDoc","DocumentName")

SetCurrent("ActiveDoc","Documentname")

This function will activate an already open document so it gets the focus. Timer Function and many other async functions will send message to the active document, so you need to make sure that the correct document is active before you send messages to it. You can use this in combination wtih GetCurrent("IsDocOpen","Documentname") so you open the document if it is not already open, and activate it if it is already open.


Written by DataEase 08/09/16 at 15:22:08 Dataease [{8}]FIVE
DG3_ForumList