I'd change your filterButton click handler to the following: $('#filterButton').click(function(event) { event.stopPropagation(); $('#filterDialog').dialog('open'); setFilterDialogPosition(); }); and I'd make a similar modification to your legendButton click handler.
Doing so has the page functioning as expected in my test. On Mon, Oct 19, 2009 at 11:39 AM, Matt Ball <mattjb...@gmail.com> wrote: > > I set up a test on jsbin that exactly reproduces the problem. Please > have a look. > > http://jsbin.com/eqaba/ > > To reproduce, open both dialogs (order doesn't matter), and then close > the filter dialog by clicking the "x" or "OK" button. > If you then click the "filter" button, it brings both dialogs back. > > To see the source HTML and Javascript: http://jsbin.com/eqaba/edit > > Thanks, > Matt > > On Oct 16, 8:44 pm, "Richard D. Worth" <rdwo...@gmail.com> wrote: >> Doesn't sound like anything I've seen. You mention you have two dialogs in a >> jQuery UI Tab. Does the issue persist if you remove the tabs and just have >> two dialogs. Would be great if you could put together a minimal test page >> demonstrating the problem. If you don't have a way to host the page >> publicly, please post to jsbin.com:http://jsbin.com/ >> >> Thanks. >> >> - Richard >> >> On Fri, Oct 16, 2009 at 2:48 PM, Matt Ball <mattjb...@gmail.com> wrote: >> >> > I have two dialogs that live in one jQuery UI Tab. The pre-init markup >> > for the two dialogs: >> >> > <div style="display: none;" id="filterDialog"> >> > <div> >> > <input type="checkbox" checked="checked" value="AO" >> > name="type"/>AO<br/> >> > <input type="checkbox" checked="checked" value="AR" >> > name="type"/>AR<br/> >> > <input type="checkbox" checked="checked" value="HQ" >> > name="type"/>HQ<br/> >> > <input type="checkbox" checked="checked" value="PR" >> > name="type"/>PR<br/> >> > <input type="checkbox" checked="checked" value="RS" >> > name="type"/>RS<br/> >> > <input type="checkbox" checked="checked" value="SS" >> > name="type"/>SS<br/> >> > <input type="checkbox" checked="checked" value="TT" >> > name="type"/>ST >> > </div> >> > </div> >> >> > <div style="display: none;" id="legendDialog"> >> > <table id="legendTable"> >> > <tbody> >> > <tr><td style="background-color: rgb(70, 132, 238); width: >> > 1.5em;"/><td>AO</td></tr> >> > <tr><td style="background-color: rgb(220, 57, 18); width: >> > 1.5em;"/><td>AR</td></tr> >> > <tr><td style="background-color: rgb(0, 0, 0); width: >> > 1.5em;"/><td>HW</td></tr> >> > <tr><td style="background-color: rgb(255, 153, 0); width: >> > 1.5em;"/><td>PR</td></tr> >> > <tr><td style="background-color: rgb(25, 142, 71); width: >> > 1.5em;"/><td>RS</td></tr> >> > <tr><td style="background-color: rgb(153, 0, 153); width: >> > 1.5em;"/><td>SS</td></tr> >> > <tr><td style="background-color: rgb(38, 216, 197); width: >> > 1.5em;"/><td>TT</td></tr> >> > </tbody> >> > </table> >> > </div> >> >> > Here's how I initialize the dialogs: >> >> > $('#filterDialog').dialog({ >> > title: 'Filter', >> > width: 200, >> > autoOpen: false, >> > draggable: true, >> > resizable: false, >> > buttons: { >> > 'OK': function(){ $('#filterDialog').dialog('close'); } >> > } >> > }); >> >> > $('#legendDialog').dialog({ title: 'Filter', width: 200, autoOpen: >> > false, draggable: true, resizable: false }); >> >> > Each dialog is opened by clicking a button: >> >> > $('filterButton').click(function(event) { $('#filterDialog').dialog >> > ('open'); }); >> > $('#legendButton').click(function(event) { $('#legendDialog').dialog >> > ('open'); }); >> >> > The problem is this: if both dialogs are open simultaneously, closing >> > #filterDialog (by clicking the "x" button, or the "ok" button) also >> > closes #legendDialog. Once this happens, if I click the button to open >> > #filterDialog again, both dialogs are opened. Closing #legendDialog >> > does not cause any incorrect behavior. >> >> > All of the initialization for the filter button and dialog runs before >> > all of the initialization code for the legend button and dialog. >> > Reversing the order does not affect the inconsistent behavior >> > described above. >> >> > Has anyone else had similar problems, or have suggestions about what >> > might be going wrong? I've written a workaround for now, but it's a >> > hack and isn't a good solution to the underlying problem. >> >> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery-ui@googlegroups.com To unsubscribe from this group, send email to jquery-ui+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---