|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We are not aware of any problems like this. Can you post a test page that reproduces the problem?
Thanks!
|
|
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
|
|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Thanks for the additional information!
|
|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
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!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
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!
|
|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
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
|
|