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

Find RadWindow RadControl from Masterpage...

2 Answers 78 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
TaponiaSoftware
Top achievements
Rank 1
TaponiaSoftware asked on 02 Aug 2013, 09:15 AM
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 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 07 Aug 2013, 06:35 AM
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.
0
TaponiaSoftware
Top achievements
Rank 1
answered on 08 Aug 2013, 07:01 AM
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());
                      }
                  }
     
              }
Tags
Ajax
Asked by
TaponiaSoftware
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
TaponiaSoftware
Top achievements
Rank 1
Share this question
or