Welcome Guest Search | Active Topics | Sign In | Register

EO Dialog and OnTextChanged on firefox Options
Joel N
Posted: Wednesday, December 17, 2008 2:17:54 PM
Rank: Member
Groups: Member

Joined: 10/7/2008
Posts: 14
Hi, I have a text field inside a dialog with an OnTextChanged event on it.

<asp:TextBox ID="txtNickName" runat="server" Width="300" OnTextChanged="CheckGroupNameAvailability" AutoPostBack="true"></asp:TextBox>

On IE it works fine, but on firefox the event only fires the first time I open the dialog, after I close it and reopen the event doesnt get fired any more. I we recently upgraded to latest EO dll, and I dont remember this as a problem before. Were there changes in the way you do dialogs? Any suggestions?

thanks
Joel


eo_support
Posted: Wednesday, December 17, 2008 4:20:58 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,087
Hi,

We are not aware of any problems like this. Can you post a test page that reproduces the problem?

Thanks!
Joel N
Posted: Thursday, December 18, 2008 2:23:22 PM
Rank: Member
Groups: Member

Joined: 10/7/2008
Posts: 14
Ok, I finally reproduced it outside my app, it takes 3 files:
- a page (TestPage.aspx)
- dialog1 (TestDialog.aspx)
- dialog2 (TestOtherDialog.aspx)

the way the problem happens, open page, click the button, a dialog will open, you will notice the onchange works there. Then click the button on that dialog, it closes that one and opens another dialog, then click that button and the dialog will close. Then no more javascript working on firefox. On IE, it works fine as many loops as I want.

It would probably be easier to send you a zip than to try to dump all the files into here. Let me know the best way to get them to you.

thanks
Joel
Joel N
Posted: Friday, December 19, 2008 8:19:20 AM
Rank: Member
Groups: Member

Joined: 10/7/2008
Posts: 14
I found a workaround to my problem (which may help you track down the real issue)

When closing 1 dialog and opening another, I was stringing them together into one startup script:

System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(),"closeAndGo","window.closeGenericDialog('dlgCreateCommunity');window.parent.showDialog('Welcome to your community', '" + base.ResolveUrl("~/Pages/TestOtherDialog.aspx") + "','welcomeToCommunityDialog');", true);

If I separate them into 2 scripts the problem goes away:

System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "closeIt", "window.closeGenericDialog('dlgCreateCommunity');", true);
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "goForIt", "window.parent.showDialog('Welcome to your community', '"
+ base.ResolveUrl("~/Pages/TestOtherDialog.aspx") + "','welcomeToCommunityDialog');", true);


I am still really curious what could be happening, Im guessing its some sort of infinite loop that ties up the js engine for good.

thanks
Joel
eo_support
Posted: Friday, December 19, 2008 8:25:26 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,087
Thanks for the additional information!
Joel N
Posted: Friday, December 19, 2008 8:45:08 AM
Rank: Member
Groups: Member

Joined: 10/7/2008
Posts: 14
well, putting them in 2 works great in firefox, but breaks in IE, I think IE the order of startup scripts might execute differently, so this work around is not a good one.
thanks
Joel
eo_support
Posted: Friday, December 19, 2008 5:49:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,087
Hi,

We tested your code with both VS2005 and VS2008 (we removed reference to Linq on VS2005) and all cases worked fine here. This includes on IE/FF and one/two RegisterStartupScript scenarios. Is it possible for you to host the test page online so that we can see if that reproduces the problem?

Thanks!
eo_support
Posted: Monday, December 22, 2008 6:12:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,087
Hi,

We have looked into the code that you sent to us as well as your online version. It appears to be FireFox bug, but we may have a workaround for it.

The root of the problem seems to be that you are trying to hide the dialog from within the dialog. For whatever reason, FireFox does not seem to be taking this well. In a way, it looks like you are trying to take out the ladder you are standing on.

We made the following changes to the code and it appears to work:

1. Move function closeGenericDialog into TestPage.aspx (You will also need to modify the function to remove window.$clearHandlers(this));

2. Add a new function closeAndGo inside TestPage.aspx:

Code: JavaScript
function closeAndGo(dlgToClose, title, url, name)
{
    window.setTimeout(
        function()
        {
            closeGenericDialog(dlgToClose);
            if (url)
                showDialog(title, url, name);
        }, 10);
}


3. Change the code inside TestDialog.aspx and TestOtherDialog.aspx to call this new closeAndGo function. Inside TestDialog.aspx, you would call it with all four parameters including the Url; Inside TestOtherDialog you would call it with only one parameter so that it only closes the dialog without showing a new one. In both case, you would use window.parent.closeAndGo to reference this function since the function is defined inside TestPage.aspx;

Two key points about these changes are:

1. All calls goes to the parent window (TestPage.aspx) first. This is to avoid the situation where you first close the dialog, which may trigger the browser to tear certain things down about the page you are currently in, but at the same moment you also start to make the next call to call code exactly inside this very page;

2. Once the call goes to the parent window, it use a timer to trigger the real action later. This is to allow the original caller (which originates from the dialog) to exit immediately;

Once we made the above changes, it seems to work. Please let us know how it works out for you.

Thanks!
Joel N
Posted: Tuesday, December 23, 2008 1:19:56 PM
Rank: Member
Groups: Member

Joined: 10/7/2008
Posts: 14
This worked, thanks a ton, have you filed a bug with Firefox, out of pure nerd curiosity I am interested in this, if you can send me a link that would be cool.
thanks
Joel
eo_support
Posted: Tuesday, December 23, 2008 1:51:53 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,087
Hi Joel,

We have not. There are still a lot of bugs that are filed years ago that are still unresolved. So we don't hold much hope on them. :)

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.