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

Unable to return arguments from radwindow

5 Answers 141 Views
Window
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 26 Jan 2010, 11:50 AM
Hi Team,

I searching desesperatly to return my arguments or other solution to return values from my RadWindow to my main page. I have used fine in last Q3 2008 but now I have tried many methods without solution using Q2.2009. I need urgently one solution using internal or other to fix this problem.
Using

OnClientClose

 

="clientClose" or other javascript including prototype if need

 


From open Radwindow
function OK_Clicked()  
            {  
                var oWindow = GetRadWindow();  
                //Get current content of text area  
                var oNewText = document.getElementById("myID").value;  
                var oNewText2 = document.getElementById("myID2").value;  
                oWindow.argument = oNewText + ";" + oNewText2;  
  
                oWindow.close();              
            }  
 

Main Page
function clientClose(window)  
                                                    {  
                                                        
                                                      //alert(window.argument);  
                                                     if (window.argument != null)  
                                                     {  
                                                       //alert("OnClientClose:" + window.get_name() + " argument:"   + window.argument);  
                                                         var oArea = document.getElementById("myField1");  
                                                         var oArea2 = document.getElementById("myField2");  
                                                       //split argument ";"  
                                                        var s=window.argument;  
                                                        var val=s.split(";");  
                                                        oArea.value = val[0];  
                                                        oArea2.value= val[1];  
                                                     }  
                                                    } 

Thanks.

5 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 28 Jan 2010, 12:17 PM
Hello Pierre,

You can pass the argument by simply passing it to the close method as shown in the demo below:

http://demos.telerik.com/aspnet-ajax/window/examples/clientsideevents/defaultcs.aspx?product=window

Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Pierre
Top achievements
Rank 1
answered on 28 Jan 2010, 12:31 PM
Hi Svetlina,

I use this same method and eventArgs are NULL ( NO returning anything!). I need urgently one solution or work around for the last Q2 2009.

function OnClientclose(sender, eventArgs) 
        { 
           alert(eventArgs);
           if(eventAgens!=null)
           }
            var arg = eventArgs.get_argument(); 
            if(arg) 
            { 
               radalert("A custom argument was passed. Its value is: " + arg); 
               LogEvent("<strong>OnClientClose</strong>: The RadWindow is closed with an argument. The provided argument is: " + arg); 
            } 
            else 
            { 
                LogEvent("<strong>OnClientClose</strong>: RadWindow is closed"); 
            }
          }
        } 

Thanks
0
Svetlina Anati
Telerik team
answered on 01 Feb 2010, 01:06 PM
Hello Pierre,

Did you close the RadWindow with the argument as GetRadWindow.close(myArgument)  ? If so, I am not sure what might be wrong since the code snippet you have provided seems correct. Make also sure that the argument is by any chance null itself.

If this does not help, please prepare fully runnable code and post it here (both the main and the content page), no need for complex custom logic, just a RadWindow and the argument passing and I will examine it and help you achieve what you need.

Greetings,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Xorcist
Top achievements
Rank 1
answered on 02 Feb 2010, 08:45 PM
What if I'm not calling window.close()? What if I need to handle a close operation where the user is closing the window via the X in the corner? Say for instance I need to know whether the window performed a specific operation (denoted by setting it's argument) and want to run an event on it's parent page when it closes depening on the value of that argument? How would I go about doing that?
0
Georgi Tunev
Telerik team
answered on 08 Feb 2010, 10:33 AM
Hello,

Clicking on the [X] button calls RadWindow.close(). In your case, I would suggest to use either:
  •  the OnClientBeforeClose property that sets a name of a JavaScript function to be executed when the RadWindow is closing - you can even cancel the closing of the window there as well. For example you could raise a flag in your JS when certain conditions are met and in OnClientBeforeClose to check for this flag and set whether this window should be closed or not.
  • The OnClientClose property - it sets a name of a JS function to be called when the RadWindow is closed (you cannot cancel the closing of the window in it). You could check the flag and initiate the corresponding logic depending on your flag.


Sincerely yours,
Georgi Tunev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Window
Asked by
Pierre
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Pierre
Top achievements
Rank 1
Xorcist
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or