Welcome Guest Search | Active Topics | Sign In | Register

Dialog control Options
Duane
Posted: Tuesday, September 4, 2007 1:58:36 PM
Rank: Advanced Member
Groups: Member

Joined: 9/4/2007
Posts: 114
I am implement the dialog control in a GridView, to allow users to edit some data for each row. The update command is working, but I am having some difficulty closing the dialog and refreshing the parent page. I have not seen any documentation to support this functionality. I would appreciate any comments on experience you have had with this.

Thanks,

Duane
eo_support
Posted: Tuesday, September 4, 2007 2:06:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi Duane,

There are primarily two ways to close a dialog: on the server side or on the client side. In order to close the dialog on the client side, you would do one of the following:

1. Set the dialog's AcceptButton or CancelButton. At runtime, when either of these two buttons are clicked, the dialog is closed;
2. Call the dialog's close method with Javascript:
http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.Dialog.close.html

In order to close it on the server side, you simply put any server control that would raises a postback (a Button or LinkButton, for example), then handle that button's Click event, inside that click event you can set the Dialog's InitialState to Hidden. You may not need a server side handler at all because "Hidden" is the default value.

Please feel free to let us know if you have any more questions.

Thanks
Duane
Posted: Wednesday, September 5, 2007 7:27:31 AM
Rank: Advanced Member
Groups: Member

Joined: 9/4/2007
Posts: 114
Thanks for your reply.

Unfortunately, these methods do not seem to be working as they should.
Setting the AcceptButton or CancelButton properties does not close the dialog as you suggest it should.

Where is the click event of the "close" button handled?
Handling the click event in the code-behind of the dialog there is an error indicating:

"The name 'theDialog' does not exist in the current context".

Handling the click event in the code-behind of the parent page does nothing, presumably since the button does not exist in the parent page.

I am missing something here. Do you have any more complete examples of this implimentation showing the correct handling methods? The documentation seems quite limited.

Thanks

eo_support
Posted: Wednesday, September 5, 2007 7:54:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi Duane,

Your problem is that you have the dialog at one place and you want to handle the event at another place. This does not work in ASP.NET ---- as you are already getting compile time error "The name 'theDialog' does not exist in the current context", the compiler refuses to take it for a reason. It's the same reason that handing the click event in the code-behind of the parent page does nothing. AcceptButton and CancelButton works the same way ---- you can not go out of scope.

The easiest workaround is to put both parts at one place. Putting them in different places can work but that would require you to close the dialog with Javascript, which I have already mentioned in my previous reply. Our demos use this method extensively to display the dialog (search for ".show(true)" in the demo), you can close the dialog the same way.

Thanks
Duane
Posted: Wednesday, September 5, 2007 9:11:19 AM
Rank: Advanced Member
Groups: Member

Joined: 9/4/2007
Posts: 114
Yes, that is correct, I have the ContentUrl set from the HyperLink in the Gridview ( from the sproc ), which loads another page as the content for the dialog. I see now that having the page content separate from the parent page is the issue.

The save button is working, and I can just use the default close button "X", but, I still need to find a way to refresh or re-bind the GridView when the dialog closes so the GridView reflects the changes just made by the user.

Thanks

eo_support
Posted: Wednesday, September 5, 2007 9:30:46 AM
Rank: Administration
Groups: Administration

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

You can use Javascript to close dialog:

http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=411

You can also put the GridView (may as well as the dialog) inside a CallbackPanel and then call eo_Callback the same way to update the GridView and the dialog.

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.