CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Best practices

by Soren SDF » 07 May 2015 12:04

Hi.

I'm working on a new application that relies heavily on dialogs.
I have a main form show a couple of grids and depending on which grid i select a row in i want pop up a different dialog. To make things more complicated i also want to be able to show a dialog when i click a button on the dialog. I may also want to open a third dialog from the second one. etc etc. I would prefer to have the different dialogs reside in their own .pas files.
Is this possible, or could there be potential problems?

Regards
Sören
Soren SDF
 
Posts: 87
Joined: 19 Apr 2013 15:56

by Jorge Sousa » 07 May 2015 16:35

Hi Sören

I don't see no reason for not using multiple dialogs stacked.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Soren SDF » 08 May 2015 12:55

One problem i have is how to close the dialog with a custom button.
Rather than clicking the X icon i want to have my own button executing some code before i close the dialog.
I can execute the code but the dialog wont close.
I have tried setting MyDialog.Visible:=False and MyDialog.JQDialogOptions.Close but neither seems to work.
It closes fine with the X though.

Sören
Soren SDF
 
Posts: 87
Joined: 19 Apr 2013 15:56

by Jorge Sousa » 08 May 2015 14:13

Hi Sören

You've to send us a test case because we cannot reproduce any of these
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by zsleo » 08 May 2015 19:46

I have had the same problem many times. Especially with stacked and reused dialogs.

The only solution I found is to add a line of code after calling close or hide: ProcessCommand (0);

Regards
zsleo
 
Posts: 776
Joined: 03 Feb 2013 03:33

by Soren SDF » 10 May 2015 12:32

Im not sure what you mean by ProceesCommand(0). Where is that declared?
I'll try to make a test project to demonstrate the problem and post it in this thread.

Soren
Soren SDF
 
Posts: 87
Joined: 19 Apr 2013 15:56

by zsleo » 11 May 2015 03:35

It is declared in IWCGFrame.

You can also add the following private procedure to a unit and call ProcessCommand(0, nil):

procedure [T_Form_or Frame_Class].ProcessCommand(ACommand: Integer; AParams: TStrings);
begin
{ }
end;
zsleo
 
Posts: 776
Joined: 03 Feb 2013 03:33

by Soren SDF » 11 May 2015 08:41

OK. So this could be a clue maybe?
I have created a TIWAppForm and put the dialog on it. Is that a problem?
Is the recommended method doing this on a frame?

Sören
Soren SDF
 
Posts: 87
Joined: 19 Apr 2013 15:56

by ScottWGast » 11 May 2015 15:20

The main problem that I've had with stacked, modal dialogs is ensuring that the z-index value for each dialog layer (including all of the editable components) is incrementally higher on each subsequent dialog.

Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Jorge Sousa » 11 May 2015 16:49

Hello all

I just uploaded a demo that demonstrates how to do this, the secret is the Frame's ownership and name. Intraweb has an old bug, if you create a frame owned by a frame, it doesn't create an unique HTML ID. Besides this, the Parent of the dialog's frame must always be the IWForm.

We don't need to adjust the ZIndex for the dialog, only for the controls in the dialog. The Dialog's ZIndex is automatically adjusted by jQueryUI itself (if JQDialogOptions.Stack = True, defauly value).

I hope it helps.
You do not have the required permissions to view the files attached to this post.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

Next

Return to JQDialog

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.