Welcome Guest Search | Active Topics | Sign In | Register

Dialog getResult() returns undefined Options
Oliver
Posted: Monday, March 2, 2009 8:16:14 AM
Rank: Newbie
Groups: Member

Joined: 7/12/2007
Posts: 5
I have this dialog on my webpage:

Code: Visual Basic.NET
<eo:Dialog AnchorElementID="ctl00_BottomRight" runat="server" id="BalloonDialog" BackColor="#47729F" ControlSkinID="None"
	    Width="250px" AcceptButton="hlCloseBalloonDialog" ClientSideOnAccept="doCloseDialog" ContentHtml="<span id='dialog_content'></span>" Height="100px"
	    HeaderHtml="<span id='dialog_header1'></span><span id='dialog_header2' style='visibility: hidden'></span>" BackShadeColor="Blue" AllowResize=false AllowMove=true>
        <ShowEffect Type="GlideBottomToTop"></ShowEffect>    
	    <FooterStyleActive CssText="border-right: #22456a 1px solid; padding-right: 4px; border-top: #7d97b6 1px solid; padding-left: 4px; border-left-width: 1px; font-size: 11px; border-left-color: #728eb8; padding-bottom: 4px; color: white; padding-top: 4px; border-bottom: #22456a 1px solid; font-family: verdana;"></FooterStyleActive>
	    <HeaderStyleActive CssText="border-right: #22456a 1px solid; padding-right: 4px; border-top: #ffbf00 3px solid; padding-left: 4px; font-weight: bold; font-size: 11px; padding-bottom: 2px; color: white; padding-top: 2px; border-bottom: #22456a 1px solid; font-family: verdana"></HeaderStyleActive>
	    <ContentStyleActive CssText="border-right: #22456a 1px solid; padding-right: 4px; border-top: #7d97b6 1px solid; padding-left: 4px; border-left-width: 1px; font-size: 11px; border-left-color: #728eb8; padding-bottom: 4px; color: white; padding-top: 4px; border-bottom: #22456a 1px solid; font-family: verdana"></ContentStyleActive>
        <CloseEffect Type="GlideBottomToTop"></CloseEffect>	
	    <FooterTemplate>
		    <DIV class="knaptekst" style="TEXT-ALIGN: right;">
		        <asp:LinkButton CommandName="CloseDialog" ID="hlCloseBalloonDialog" runat=server Text="Close"></asp:LinkButton>
		    </DIV>
	    </FooterTemplate>            
    </eo:Dialog>


And this javascript:

Code: JavaScript
function doCloseDialog() {
            alert(eo_GetObject('BalloonDialog').getResult());
            }
        }


When i close a dialog, this gives me 'undefined' in the alert box, but i was expecting 'CloseDialog', but maybe im doing something wrong ?
eo_support
Posted: Monday, March 2, 2009 9:17:33 AM
Rank: Administration
Groups: Administration

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

Try to change your doCloseDialog to:

Code: JavaScript
function doCloseDialog() 
{
    window.setTimeout(
        function()
        {
            alert(eo_GetObject('BalloonDialog').getResult());
        }, 10);
}


Note it delays getResult() with a setTimeout call. This is necessary because the result code is set after your ClientSideOnAccept is called. It is implemented this way because the dialog allows you to cancel dialog closing from your ClientSideOnAccept handler. So if you had canceled (by returning false from your handler), there would be no result set.

Thanks!
Oliver
Posted: Monday, March 2, 2009 9:29:04 AM
Rank: Newbie
Groups: Member

Joined: 7/12/2007
Posts: 5
Thanks alot. This works...


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.