Welcome Guest Search | Active Topics | Sign In | Register

EO Dialog Options
Vaughan
Posted: Tuesday, September 12, 2017 7:27:17 PM
Rank: Advanced Member
Groups: Member

Joined: 7/2/2008
Posts: 35
I have a number of code-generated links in a table and want them all to trigger the same dialog but with different parameters.
The dialog only has one SHOW property. Are you able to advise how I can do this ? Or perhaps it can't be done ?
eo_support
Posted: Wednesday, September 13, 2017 8:03:21 AM
Rank: Administration
Groups: Administration

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

If you are displaying the dialog on the client side, you can pass your additional parameters through the third argument (initData argument) of the show method:

https://www.essentialobjects.com/doc/jsdoc.public.web.dialog.show.aspx

That argument will be passed to your client side ClientSideOnInitDialog event handler, where you can act accordingly.

If you are displaying the dialog on the server side, you would just modify the dialog contents on the server side before you call its Show method. For example, if you use ContentTemplate to define your content, then you can use something like this to access controls inside the ContentTemplate:

Code: C#
//Get a Label control whose ID is "Label1" defined inside ContentTemplate
Label label = (Label)dialog1.ContentContainer.FindControl("Label1");

//Set the Label's Text
label.Text = "something";

//Show the dialog
dialog1.Show();


Hope this helps. Please feel free to let us know if you still have any question.

Thanks!
Vaughan
Posted: Wednesday, September 13, 2017 7:43:01 PM
Rank: Advanced Member
Groups: Member

Joined: 7/2/2008
Posts: 35
Displaying Client-side. Javascript cannot find the dialog, I'm getting a message ''Object doesnt support the method show". I have tried with 'Show' and 'show'

The EO:Dialog is inside the placeholder and has ID Dialog1. Is there anything else I need to do ? Appreciate your help



The code giving the message is as follows....

function ShowBooking() {
try {
var Dialog = document.getElementById("<%=Dialog1.ClientID%>");

Dialog.Show()

}
catch(err){
alert(err.message);
}

}
Vaughan
Posted: Thursday, September 14, 2017 12:44:53 AM
Rank: Advanced Member
Groups: Member

Joined: 7/2/2008
Posts: 35
OK, solved this one. Needed to use eo_GetObject.

However, now the dialog displays but closes automatically after 1 sec. The dialoge content is just a label with test data.

I have no idea what is closing the dialog.

Any suggestions?

eo_support
Posted: Thursday, September 14, 2017 11:21:59 AM
Rank: Administration
Groups: Administration

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

We are not aware of such issues. You can compare your code with any of our sample under Demos/Dialog/Features folder that uses client side show method and see if you can find what triggered the problem. Usually as soon as you find out what triggered the problem, it should make sense to you why it happens.

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.