Welcome Guest Search | Active Topics | Sign In | Register

Set Open Dialog state to DialogState.Hidden does not work Options
Sarge
Posted: Tuesday, September 18, 2007 8:59:09 AM

Rank: Member
Groups: Member

Joined: 9/14/2007
Posts: 21
I have a Dialog with an AJAXUploader control and several other controls in it. I open the dialog by setting the DialogState to Visible, when the save is complete I then set the DialogState to Hidden, this results in the dialog closing, but the background does not return to normal nor does the "modal" effect go away.
The page ends up being useless as the controls are nor longer interactive.
The Dialog is set to be modal with a gray background.
Here are the dialogs properties.

Code: HTML/ASPX
<eo:Dialog runat="server" id="dlgFileEditor"
	CloseButtonUrl="/masterpages/theme_orange/Close_Simple.png"
	IsModal="true" AllowResize="True"
	ControlSkinID="None" Width="500px"  
	ShadowColor="LightGray"   ShadowDepth="3"
	ResizeImageUrl="00020014" HeaderHtml="File Editor"
	BackShadeColor="gray" BackShadeOpacity="50"	>


I then use this command to "close" the dialog.
Code: C#
dlgFileEditor.InitialState = DialogState.Hidden;


Am I missing something?

David L. Sargent
Developer
Washington State University
eo_support
Posted: Tuesday, September 18, 2007 9:19:43 AM
Rank: Administration
Groups: Administration

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

It seems that we need you to post more code this time. :) We tested the following scenario and it works fine:

1. Create a blank form, put a ScriptManager and UpdatePanel in the form (I am assuming that this is your scenario based on your previous posts);
2. Place a dialog in the UpdatePanel's ContentTemplate. Give the dialog a BackShadeColor;
3. Place a server button inside the dialog's ContentTemplate;
4. Handle the button's Click event:

Code: C#
Dialog1.InitialState = EO.Web.DialogState.Hidden;


We then ran the test and it works as expected. Can you compare your scenario with this and see if you can spot anything?

Thanks
Sarge
Posted: Tuesday, September 18, 2007 10:23:27 AM

Rank: Member
Groups: Member

Joined: 9/14/2007
Posts: 21
OK, got it figured out.
I have all of my "editors" inside of a Panel control. When the editors are not being used I have the panel control visibility set to false
Code: C#
pnlEditors.Visible = false;

So, just before I go to show the File Editor, I set the main panel to visible and then do the show, this works fine. However, if I set the main panel to false right after setting the dialog to not show, then the "lockup" occurs.
My purpose in doing this is to cut down on the code being rendered and sent to the browser, this helped shave a ton of generated HTML and JavaScript off our CMS and speed up overall page load (almost 100K) This may not be necessary with your controls but is for some of the other stuff I am doing.

I have also noticed that using this method adds about 2 seconds to the display of the dialog.

Is there a solution? or should I just not turn off the panel for the time being?

I have created a test page, here is the code.
Code: HTML/ASPX
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="btn1" runat="server" OnClick="btn1_Onclick" Text="Show Panel" />

<asp:Panel ID="pnl1" runat="server" Visible="false" >
<eo:Dialog runat="server" id="dlgFileEditor"
	CloseButtonUrl="/masterpages/theme_orange/Close_Simple.png"
	IsModal="true" AllowResize="True"
	ControlSkinID="None" Width="500px"  
	ShadowColor="LightGray"   ShadowDepth="3"
	ResizeImageUrl="00020014" HeaderHtml="File Editor"
	BackShadeColor="gray" BackShadeOpacity="50"	>
	<HeaderStyleActive CssText="Color:#fff; font-weight:bold; padding-right: 4px; padding-left: 4px; background:url('/masterpages/Theme_Orange/TitleBar.png') repeat-x left top;"></HeaderStyleActive>
	<ContentStyleActive CssClass="ControlBackground"></ContentStyleActive>
	<ContentTemplate>
		<asp:Button ID="btn2" runat="server" OnClick="Close" Text="Close" />
	</ContentTemplate>
	</eo:Dialog>
</asp:Panel>
<eo:CallbackPanel ID="CallbackPanel1" runat="server" Height="150px" Width="200px">
</eo:CallbackPanel>
</ContentTemplate>
</asp:UpdatePanel>


Code: C#
protected void btn1_Onclick(object sender, EventArgs e)
{
	pnl1.Visible = true;
	dlgFileEditor.InitialState = DialogState.Visible;
}
protected void Close(object sender, EventArgs e)
{
	dlgFileEditor.InitialState = DialogState.Hidden;
	pnl1.Visible = false;
}


David L. Sargent
Developer
Washington State University
eo_support
Posted: Tuesday, September 18, 2007 10:34:43 AM
Rank: Administration
Groups: Administration

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

Editor components generally intercepted form.submit but a number of editors is known to have problem with calling the orignal form.submit, which is hooked up with our "torn down" code to remove the back shade. It appears that that code is not being properly called.

You can try to call Page.RegisterOnSubmitStatement to always hide our dialog with JavaScript before the form submit and see if that helps.

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.