I know this is going to sound strange, but, we have had our PWC
dialogs working great for months before this all of a sudden started
happening. After we recently upgraded to version 1.0 of the FireBug
extension for Firefox, every dialog is now being opened two times when
the link is clicked that used to open a single instance just fine. I'm
not blaming FireBug 1.0 for the problem, but, clearly the problem is
occurring due to some interaction with the newer version of FireBug.
We are still using version 0.98 of PWC. I was waiting to upgrade until
after we had successfully done our initial launch of the site.

Luckily, the problem code is on our public site now for examination.
Technically, we aren't launching the new site until Monday morning.
However, we switched over after close of business on Friday to do some
last minute testing over the weekend on the live site. If you are
using Firefox (1.5 or 2.0) with the FireBug 1.0 extension, you should
be able to see the problem yourself. Go to our site:

  http://www.krillion.com

And click on the feedback link in the upper right corner of the page.
An alert gets displayed warning that, "Window feedbackDialogId is
already registered in the DOM!" This is happening because our user
feedback dialog gets opened twice for a single click on that link. The
snippet of the page where the link is defined is this:

<div id="siteFeedback" onClick="evalCode('open_feedback'); return false">
   Feedback
</div>

The snippet with the javascript that opens the window is here:

<div style="display:none" id="open_feedback_codediv">
   <xmp id="open_feedback">
      Dialog.confirm({url: "/ajax/xA-feedbackSetup", options: {method:
'get', asynchronous:false}},
      {windowParameters: {title:"<div id='headFeedback'>&nbsp;</div>",
className: "kdialog",  width:600, height:350, zIndex: 1500,
resizable:false, recenterAuto:false, showEffect:Effect.BlindDown,
hideEffect:Effect.Fold, draggable:true}, okLabel: "Send",
      buttonClass: "feedbackButtonClass",
      id: "feedbackDialogId",
      cancel:function(win) {},
      ok:function(win)
{sendFeedback(document.getElementById('feedForm'));
window.setTimeout(Dialog.okTimeout,1500)}
       });
       NiftyLoad();
   </xmp>
</div>

In case you are wondering what Dialog.okTimeout() function is, I added
that to our version simply so I could implement the delayed close
effect that we use for our feedback dialog to apply the 2 cents
postage stamp to the feedback before the dialog closes. It has the
same logic as the Dialog.cancelCallbak() with one important
difference. It doesn't try to call the cancelCallback function defined
for the window. Here is the new function I added and the one it was
cloned from:

    okTimeout: function() {
        var win = Windows.focusedWindow;
        // Remove onclick on button
        $$("#" + win.getId()+" input").each(function(element)
{element.onclick=null;})
        win.hide();
    },

    cancelCallback: function() {
        var win = Windows.focusedWindow;
        // Remove onclick on button
        $$("#" + win.getId()+" input").each(function(element)
{element.onclick=null})
        win.hide();
        if (win.cancelCallback)
            win.cancelCallback(win);
    }

So, any ideas how I am screwing up that only now is showing up with
FireBug 1.0 installed? :-)

-Van

Mike "Van" Riper
Principal Software Engineer
Krillion, Inc.
http://www.krillion.com

_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com

Reply via email to