Find RadWindow RadControl from Masterpage...

3 posts, 0 answers
  1. TaponiaSoftware
    TaponiaSoftware avatar
    11 posts
    Member since:
    Jul 2013

    Posted 02 Aug 2013 Link to this post

    Hello,

    I want to raise an ajaxRequest from a Masterpage to a RadAjaxPanel within a RadWindow.
    Is this possible? - My resulting object is always null...

    My clientside code within RadWindowManager OnWindowBeforeClose Event:

    function OnWindowBeforeClose(sender, args) {
        
       var oOpener = sender.get_openerElementID(); // OpenerElementID is the Ajaxable Object (RadAjaxPanel in this case)
       if (oOpener != null) {
     
              var oMan = GetRadWindowManager();
              var oActive = oMan.getActiveWindow();
              if (oActive != null) {
                    var content = oActive.get_contentFrame().contentWindow;
     
                               // how can i find the object here?
                               var oAjaxable = content.get$(oOpener); // results = null
                               var oAjaxable = $telerik.$(oOpener); // results = null
     
                               if (oAjaxable.ajaxRequest != null) {
                                    oAjaxable.ajaxRequest("beforeclose::" + args.get_argument());
                                    return;
                                }
     
              }
     
       }
     
    }


    Thanks

    Stefan
  2. Angel Petrov
    Admin
    Angel Petrov avatar
    1007 posts

    Posted 07 Aug 2013 Link to this post

    Hello Stefan,

    If I am correct you have a RadWindow which has a RadAjaxPanel inside it and you want to raise an AJAX request using client-side logic. If this is the scenario you should not experience any problems firing the request. Since I am not familiar with the exact setup I have prepared a sample website which demonstrates a possible realization. Please examine the attached example and tell us if this is what you were looking for.

    Regards,
    Angel Petrov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. TaponiaSoftware
    TaponiaSoftware avatar
    11 posts
    Member since:
    Jul 2013

    Posted 08 Aug 2013 Link to this post

    Thank you, i think i found another solution:

    The problem was i have to check if the closed window is a RadWindow or not... Sometimes it is a subwindow of another RadWindow and i wanted to report the "opener" RadWindow the result of the child RadWindow (like: saved and change content / refresh)
    function OnClientClose(sender, args) {
     
                      var oOpener = sender.get_openerElementID();
                      if (oOpener != null) {
                          var oAjaxable = $find(oOpener);
                          if (oAjaxable != null) {
                              if (oAjaxable.ajaxRequest != null) {                    
                                  oAjaxable.ajaxRequest("closed::" + args.get_argument());                               
                                  return;
                              }
                          }
                      }
     
                      var oMan = GetRadWindowManager();
                      var oActive = oMan.getActiveWindow();
                      if (oActive != null) {
                          if (oOpener != null) {
                              var content = oActive.get_contentFrame().contentWindow;                          
                              var oAjaxable = content.$find(oOpener)
                              if (oAjaxable != null) {
                                  if (oAjaxable.ajaxRequest != null) {
                                      oAjaxable.ajaxRequest("closed::" + args.get_argument());
                                      return;
                                  }
                              }
     
                          }
     
                          if (oActive.get_contentFrame().contentWindow.reload != null) {
                              oActive.get_contentFrame().contentWindow.reload(args.get_argument());
                          }
                      }
         
                  }
Back to Top