This is a migrated thread and some comments may be shown as answers.

Client events not firing in radajaxupdatepanel

2 Answers 41 Views
Window
This is a migrated thread and some comments may be shown as answers.
Adam Toth
Top achievements
Rank 1
Adam Toth asked on 19 Aug 2010, 06:41 PM
Hi there,

I am creating an employee dashboard similar to an iGoogle implementation.

I am using the radtabstrip and radwindowmanager inside of a radajaxupdatepanel. When a tab is clicked, an ajax postback occurs, the previously open radwindows are removed from the radwindow manager (on the server side), and new radwindows are created (again on server side).

After the ajax postback is done, the windows appear properly, but do not fire their dragend and resizeend client events the first time the user drags/resizes after the postback. The user has to drag/resize at least twice before the events are fired.

Should I be doing something else to ensure that the events are wired up?

Thanks,

Adam

2 Answers, 1 is accepted

Sort by
0
Adam Toth
Top achievements
Rank 1
answered on 20 Aug 2010, 07:58 PM

On further investigation, the events are actually firing properly, but the window size and position is not being correctly reported. I am trying to save the window position and size in a SharePoint list using an ajax call from the SharePoint client object model.

It appears that the getWindowBounds function is not completely updated at the time that the DragEnd or ResizeEnd events are fired.

function OnRadWindowDragEnd(sender, eventArgs) {
    alert("Drag End");
      
    _ctx = new SP.ClientContext.get_current();
    _web = _ctx.get_web();
    var applicationId = GetApplicationIdFromWindowName(sender.get_name());
    var list = _web.get_lists().getByTitle("User Applications");
    var listItem = list.getItemById(applicationId);
    listItem.set_item("Top", sender.getWindowBounds().y);
    listItem.set_item("Left", sender.getWindowBounds().x);
    listItem.update();
    _ctx.executeQueryAsync(Function.createDelegate(window, window.onUpdate), Function.createDelegate(window, window.onFail));
}

0
Adam Toth
Top achievements
Rank 1
answered on 20 Aug 2010, 08:13 PM
The setTimeout solution in this post worked a treat for me:

http://www.telerik.com/community/forums/aspnet-ajax/window/getting-top-left-in-onclientdragend.aspx

Everything is working well now.

Adam
Tags
Window
Asked by
Adam Toth
Top achievements
Rank 1
Answers by
Adam Toth
Top achievements
Rank 1
Share this question
or