Client events not firing in radajaxupdatepanel

3 posts, 0 answers
  1. Adam Toth
    Adam Toth avatar
    41 posts
    Member since:
    Oct 2005

    Posted 19 Aug 2010 Link to this post

    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. Adam Toth
    Adam Toth avatar
    41 posts
    Member since:
    Oct 2005

    Posted 20 Aug 2010 Link to this post

    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));
    }

  3. Adam Toth
    Adam Toth avatar
    41 posts
    Member since:
    Oct 2005

    Posted 20 Aug 2010 Link to this post

    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
Back to Top