Welcome Guest Search | Active Topics | Sign In | Register

Dynamic text in Dialog Options
Yannick
Posted: Friday, October 26, 2007 7:23:58 AM
Rank: Member
Groups: Member

Joined: 10/25/2007
Posts: 16
Hello!

I would like to know if it's possible to set text in dialog before the dialog appear.
Actualy I'm using

Code: JavaScript
eo_GetObject('DialogToolTip').setContentUrl('ToolTip.aspx?Info=' + pLabel);


to display a custom message, but this is a little bit slow.
I'm using ajax to query our database, so I already know the text I want to show. What I need is a way to show this text in the dialog.

Maybe I can use ClientSideOnInitDialog property, but I don't understand how to use it.

Here's the code I tried so far:

Code: HTML/ASPX
<eo:Dialog runat="server" ClientSideOnInitDialog="SetTest" AnchorElementID="divPositionMouse" id="DialogToolTip" BorderStyle="Solid"
	            AllowResize="False" ControlSkinID="None" Width="300px" BorderWidth="1px" Height="200px"
	            BorderColor="#335C88" RestoreButtonUrl="00070103" ShadowDepth="3"
	            HeaderHtml="Info" ResizeImageUrl="00020014" ShowEffect-Type="Fade" CloseEffect-Type="Fade"
	            ContentUrl="http://www.google.com"> 
	            <HeaderStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 11px; background-image: url(00070104); padding-bottom: 3px; padding-top: 3px; font-family: tahoma"></HeaderStyleActive>
	            <ContentStyleActive CssText="border-top: #335c88 1px solid; background-color: #e5f1fd"></ContentStyleActive>
	            
            </eo:Dialog>




Code: JavaScript
eo_GetObject('DialogToolTip').show(false,'Info','Message I want to display');

function SetText(dialog, arg)
{
    
}


Thanks for the help!
eo_support
Posted: Friday, October 26, 2007 7:38:26 AM
Rank: Administration
Groups: Administration

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

The dialog is only a container ---- it's totally up to you to handle whatever inside. You either give it a ContentUrl or a ContentTemplate. When you give it a ContentUrl, the content of that Url is displayed and can not be altered. For example, if you set ContentUrl to Google's home page, you will see Google's home page in the dialog and you are not suppose to be alter that.

If you use ContentTemplate, then everything is in your hand. For example, you can do:

Code: HTML/ASPX
<eo:Dialog ....>
    ....
    <ContentTemplate>
        <div id="test"></div>
    </ContentTemplate>
    ....
</eo:Dialog>


You can then use

Code: JavaScript
document.getElementById("test").innerHTML = "hello!";


To change the contents of the test DIV.

Thanks
Yannick
Posted: Friday, October 26, 2007 7:55:51 AM
Rank: Member
Groups: Member

Joined: 10/25/2007
Posts: 16
Great!! thanks a lot for you help!

One more question...
Is it possible to modify the width and height of the dialog in javascript before calling the show property?

Thanks!
eo_support
Posted: Friday, October 26, 2007 7:59:51 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
No. Unfortunately you can not do that.


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.