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

[Solved] How to update several RadAjaxPanel simultaneous from javascript

4 Answers 295 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
BlackStar
Top achievements
Rank 1
BlackStar asked on 04 Mar 2008, 08:51 AM

Hello!

I need to update several RadAjaxPanels from javascript. I tried to use somethink like this:

function Update()
{
    <%= RadAjaxPanel1.GetAjaxEventReference("") %>;
    <%= RadAjaxPanel2.GetAjaxEventReference("") %>;
}

But in this case, second one panel will be updated only.

The same situation i have when try to update RadAjaxPanel and do RadComboBox requestItems method.

I think all of this linked with limit of simultaneous HTTP requests.

Can anybody help me?

4 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 04 Mar 2008, 09:42 AM
Hello BlackStar,

Would you please elaborate more on your exact scenario? Can you just use RadAjaxManager control updating ASP:Panel-s conditionally? You can trigger an AJAX request client-side via the AjaxRequest function and update the panel you need to.

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
BlackStar
Top achievements
Rank 1
answered on 04 Mar 2008, 06:03 PM
I have javascript powered application that work with WebServices and PageMethods based on Microsoft AJAX Library. In some case i use RadAjaxPanels for render content on the page. All events that will update RadAjaxPanels are placed deep in javascript logic.

Use separate RadAjaxManager for each group of RadAjaxPanels is not clear. In this case i will have 4 RadAjaxManagers for 3 RadUpdatePanel for work with all available update scenario(1 and 2, 2 and 3, 1 and 3, 1 and 2 and 3). It's not good.

Is there simple method, that allow me request to update several RadAjaxPanels like i update one panel at once?

Thank you, Konstantin.
0
BlackStar
Top achievements
Rank 1
answered on 04 Mar 2008, 06:09 PM
I am not need in one HTTP request to server, it can use any numer of requests (2 panel - 2 request), i need in quick and easy solution to update several panels from javascript.
0
BlackStar
Top achievements
Rank 1
answered on 05 Mar 2008, 04:28 AM
I found a suitable solution. It's requests queing!

var PageRequestManagerEx =
{
    _initialized : false,

    init : function()
    {
        if (!PageRequestManagerEx._initialized)
        {
            var _prm = Sys.WebForms.PageRequestManager.getInstance();
            var _callQueue = new Array();
            var _executingElement = null;

            _prm.add_initializeRequest(initializeRequest);
            _prm.add_endRequest(endRequest);

            PageRequestManagerEx._initialized = true;
        }

        function initializeRequest(sender, args)
        {
            if (_prm.get_isInAsyncPostBack())
            {
                var postBackElement = args.get_postBackElement();

                if (_executingElement != postBackElement)
                {
                    args.set_cancel(true);
                    Array.enqueue(_callQueue, new Array(postBackElement.id, $get("__EVENTARGUMENT").value));
                }
            }
        }

        function endRequest(sender, args)
        {
            _executingElement = null;
            if (_callQueue.length > 0)
            {
                _executingElement = Array.dequeue(_callQueue);
               
                var _element = _executingElement[0];
                var _eventArg = _executingElement[1];

                _prm._doPostBack(_element, _eventArg);
            }
        }
    }
}

if (typeof(Sys) != 'undefined')
{
    Sys.Application.notifyScriptLoaded();
}

Tags
Ajax
Asked by
BlackStar
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
BlackStar
Top achievements
Rank 1
Share this question
or