add_close

6 posts, 1 answers
  1. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 30 Apr 2008 Link to this post

    Hi,

    I see that there is add_close() method with Radwindow from client side. So, that we can set the client-close handler. What about ClientCallback()? Is there a client side "add_" method available to add a client-callback method?

    -Piyush
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 02 May 2008 Link to this post

    Hi Piyush,

    When using RadWindow for ASP.NET AJAX you can not set the callback function client-side as this functionality is available with RadWindow for ASP.NET. Instead of the callback functionalit, you should use the closing methods. You can find more information about this here.

    If you need further assistance, please, open a new support ticket and send us a small, working project with a detailed explanation of the desired behavior and the exact scenario. Once we receive it, we will do our best to help.

    Sincerely yours,
    Svetlina
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 08 May 2008 Link to this post

    I saw following code in the article you listed.

    currentWindow.argument
    = arg;
    currentWindow.close();

    Now, I am using add_close(closemywindow).

    Now, in function closeMyWindow(sender, args) - how do i get the value I have set to currentWindow.argumennt? or rather, what is the value stored in 'args' parameter of this close method?

    Thanks,
    Piyush
  5. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 10 May 2008 Link to this post

    Hello Piyush,

    As shown in the documentation topic that Svetlina pointed, you should use the argument property of the sender.
    e.g.
    function clientClose(window
     if (window.argument != null
     { 
       alert("OnClientClose:" + window.get_name() + 
             " argument:"   + window.argument); 
     } 
     



    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 16 May 2008 Link to this post

    Finally got this working. I wish the documentation was addressing this issue directly.

    For those who may have similar issue:

    Call the following function when you want to close the window with a return parameter.
    function CloseRadWindow2(retval)
    {
       var owin = GetRadWindow();
       owin.argument = retval;
       owin.close(retval);
       //--don't do this way --> GetRadWindow().close(retval);
    }

    function yourOnCloseMethod(sender, args)
    {
        if(sender.argument != null)
        { this is with argument}
    }

  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 17 May 2008 Link to this post

    Hello Piyush,

    Actually the topic in the documentation regarding using RadWindow as a dialog shows the 2 recommended approaches to send argument to the parent page and explains how to handle the argument:
    1. When sending the argument in the close() method, you should read the argument in the ClientCallBack function on the parent page.
    2. When using the argument property of the window object, it can be read in the OnClientClose function on the parent page - as you did in your case.

    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017