Opened 11 years ago

Closed 10 years ago

#7716 closed enhancement (duplicate)

[patch] [cla] Dialog: support multiple (nested) dialogs concurrently on the screen

Reported by: Ilginy1 Owned by: Dustin Machi
Priority: high Milestone: 1.4
Component: Dijit Version: 1.2beta
Keywords: Cc:
Blocked By: Blocking:

Description

dojo Library component dijit.Dialog doesnt support multiple (cascaded) Dialogs. More precisely, the previous Dialog isnt disabled like the rest of the screen when a second Dialog is created.

Attachments (2)

Dialog-multipleDialog.patch (766 bytes) - added by Ilginy1 11 years ago.
Multiple Dialog patch
Dialog-multipleDialog.2.patch (880 bytes) - added by Ilginy1 11 years ago.
Multiple Dialog Patch

Download all attachments as: .zip

Change History (15)

Changed 11 years ago by Ilginy1

Attachment: Dialog-multipleDialog.patch added

Multiple Dialog patch

comment:1 Changed 11 years ago by Ilginy1

We have a patch to enable the Multiple Dialog support which is directly added to the dojo toolkit library file dijit.Dialog.js,

Attached you can find the patch

comment:2 Changed 11 years ago by bill

Component: GeneralDijit
Milestone: tbd1.4
Owner: anonymous deleted
Summary: Multiple Dialog Support is missing[patch] [cla] Dialog: support multiple (nested) dialogs concurrently on the screen
Type: defectenhancement

This is a dup of #1411. I see you attached your patch there too.

I wasn't planning to support this for Dialog but I see your patch is only a few lines. If it's really that simple I guess we can add it in. Although I suspect you haven't considered keyboard. Note that this line in Dialog.js (both before and after your patch) connects to <body>:

this._modalconnects.push(dojo.connect(dojo.doc.documentElement, "onkeypress", this, "_onKey"));

Changed 11 years ago by Ilginy1

Multiple Dialog Patch

comment:3 Changed 11 years ago by Ilginy1

To also consider the hiding with Esc key we updated the patch such that: Incrementing the counter is now placed in the show method instead of setup method And decrementing the counter is placed in hide instead of destroy. (Attached you can find the updated version of the patch) Also a brief description of the patch: A new global variable is introduced which keeps track of the z-index of multiple modal dialogs. Now, the z-index of every new modal dialog is increased, i.e. <div> of 1st modal dialog's underlay : z-index = 998; <div> of 1st modal dialog itself : z-index = 999; <div> of 2nd modal dialog's underlay : z-index = 1000; <div> of 2nd modal dialog itself : z-index = 1001; ... When a modal dialog is created, the global variable is increased. When the modal dialog is closed, then the global variable is decreased. Remarks: 1- A limitation of the patch: Since we handle modalDialogs like a stack here, it is therefore not allowed to programmatically close any of the lower modal dialogs! Reason is that in case of deleting a lower dialog and creating a new one before deleting the upper ones we will get duplicate z-index values again 2- Now it is possible to hide the upper Dialog by ECS key and showing it again

comment:4 Changed 11 years ago by Ilginy1

To also consider the hiding with ECS key we updated the patch such that: Incrementing the counter is now placed in the show method instead of setup method Also decrementing the counter is placed in hide instead of destroy.
Also a brief description of the patch: A new global variable is introduced which keeps track of the z-index of multiple modal dialogs.

Now, the z-index of every new modal dialog is increased, i.e.
<div> of 1st modal dialog's underlay : z-index = 998;

<div> of 1st modal dialog itself : z-index = 999;

<div> of 2nd modal dialog's underlay : z-index = 1000;

<div> of 2nd modal dialog itself : z-index = 1001;

... When a modal dialog is created, the global variable is increased. When the modal dialog is closed, then the global variable is decreased.

Remarks: 1- A limitation of the patch: Since we handle modalDialogs like a stack here, it is therefore not allowed to programmatically close any of the lower modal dialogs! Reason is that in case of deleting a lower dialog and creating a new one before deleting the upper ones we will get duplicate z-index values again

2- Now it is possible to hide the upper Dialog by ECS key and showing it again

comment:5 Changed 11 years ago by bill

Milestone: 1.41.3

Hmm, I'm still confused, won't the lower dialog process the ESC key too? And it will try to close?

comment:6 Changed 11 years ago by Ilginy1

For the lower dialog cannot get the focus (due to a lower z-index), the ESC key does not apply to such a dialog.

comment:7 Changed 11 years ago by Ilginy1

So to be sure: what is the current situation with the patch, are you using it or do you need more information?

comment:8 Changed 11 years ago by jsloan

I've attempted using this patch in 1.2.1. As briefly mentioned above, keyboard input is not working in input boxes on the nested dialog. This is necessary as my nested dialog contains a form with inputs and a submit button. Everything else appears to work well.

comment:9 Changed 11 years ago by bill

Owner: set to Dustin Machi

Dustin is working on a dialog manager to support this. I'm going to assign this ticket to him for now and see what he comes up with.

comment:10 Changed 11 years ago by bill

Milestone: 1.31.4

bumping 1.4 tickets to 1.5, and most 1.3 tickets to 1.4

comment:11 Changed 11 years ago by manfredsv

Hi, the same problem exists not only for a common forms dialog. I need a solution for using the href-link plugin used in an editor in a dialogwindow. Because the href-plugin odens a tooltip dialog its not possible to input data directly by the keyboard. the only possibility is to have anyware a scratchpad from where you can cut/paste to the inputfields of the opened tooltip dialog. But that is not very convenient.

So we need here a common solution for this multidialog/keyboard problem.

Kind regards Manfred

comment:12 Changed 10 years ago by rwanou

I'm in great need of this patch, but after analyzing the sources of both 1.2.3 and 1.3.0 release, there seems to be a few differences between the dijit/Dialog.js file. Could the patch be updated to be compatible with both 1.2.3 and 1.3.0 releases of dijit? Thank you in advance.

comment:13 Changed 10 years ago by bill

Resolution: duplicate
Status: newclosed

Dup of #6759, will check in fix now.

Note: See TracTickets for help on using tickets.