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

get_argument not supported

7 Answers 264 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 17 Apr 2009, 08:52 AM
Hi,

I'm using the trial version of 2008.3 1105 and trying to use a radwindow as a dialog, exactly in the manner described in your online documentation.

function ImagePickerClose(sender, args){  
    if (args.get_argument()!= null)  
          {  
            alert("'" + sender.get_name() + "'" + " was closed and returned the following argument: '"+ args.get_argument() + "'");  
          }  

I get an error on the line 'if (args.get_argument()!=null' saying 'object does not support this property or method' and debugging in VS shows that the object is empty, although the 'sender' object has the correct details about the radwindow that was closed.

The code in my dialog.aspx page is as follows:

            function SaveChosenImage(){  
                var oWnd = GetRadWindow();  
                var picID = $get('<%= thisPicID.ClientID %>');  
                alert(picID.value);  
                oWnd.close(picID.value);  
            }  
 

and the alert shows that the correct argument is being passed to the oWnd.close statement. The window closes correctly.

Is this a limitation of the version I am using? Is there any other way to return an argument from the RadWindow?

Andy

7 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 17 Apr 2009, 11:37 AM
Hi Andy,

You can use that approach with the Q12009 version of the controls and we recommend you use that version. In the 2008.3 1105 version the get_argument() does not exist and you need to use one of the followings approaches :
  • use the ClientCallBackFunction function instead of OnClientClose. In this function the second argument is the passed parameter.
  • you could use the Argument property of the RadWindow object and assign it a value on the content page. Then you can access it on the parent page.
I implemented the both of the described approaches in a simple demo and attach it to this thread.

I hope this helps.

Kind regards,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Robert Vreeland
Top achievements
Rank 1
answered on 06 Jun 2009, 01:08 AM
Was get-arguments made available first in the 2009 version or earlier?
0
Fiko
Telerik team
answered on 08 Jun 2009, 04:04 PM
Hi Robert,

This functionality was first introduced in the 2008.3.1314 release of the control.

Sincerely yours,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
nirmal
Top achievements
Rank 1
answered on 13 Aug 2009, 06:17 AM
Hi,

Even I faced the same problem and found your answer as the perfect reason. But if i try the same in Firefox it dos not seem to work.
My code is something like this

function ClientCallBackFunction(oWnd,args)
        {
            alert(args);
            if(args == false)
                window.location = "acd.aspx";               
        }
the alert in IE shows true/false which is fine and as expected. But in firefox it shows [object]. I have tried using [object].value/[object].text/[object].toString() but all give result as undefined.
Can you temme how do i extract the value out of this [object].

Thanks 
Nirmal
0
Fiko
Telerik team
answered on 13 Aug 2009, 02:52 PM
Hello Nirmal,

In your case I recommend you use the OnClientClose event of the RadWindow object (I suppose that you use version Q3 2008 version and above). We marked the ClientCallBackFunction function as obsolete and we will remove it in one of the further releases. For your convenience I have implemented the OnClientClose approach in a demo project and attached it to this thread.

I hope this helps. 

Sincerely yours,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
nirmal
Top achievements
Rank 1
answered on 18 Aug 2009, 01:26 PM
Hi Fiko,

Thanks for your assistance. However I find myself in a confused state of mind. I was using the OnClientClose  function and following the exact approach as outlined in your attached project. This always used to throw an error for "get_argument()" functon. Afterwards, I found this thread in which you have instructed Andy to use the ClientCallBackFunction  and I did the same which helped me in getting rid of the error.
However this doesn't seem to work for Mozilla. My version is 2008.3.1125.35. Can you please if I am doing anything wrong and could you please also confirm if its a Q32008 version. 

Thanks 
Nirmal
0
Svetlina Anati
Telerik team
answered on 20 Aug 2009, 01:20 PM
Hi nirmal,

As Fiko explained, the logic for passing an argument was improved and changed through the different releases and this along with confusion with the different versions has lead to some misunderstanding in this thread. I prepared for you a sample demo which uses the already obsolete Argument property of RadWindow - you can find it attached. The demo works as expected with the 2008.3.1125 version you are using both under IE and FF.  However, if you decide to upgrade later you will probably need to change a little bit the logic but you can rely on our assistance for that.

I hope that the attached demo is helpful, let me know how it goes.


Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Andy
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Robert Vreeland
Top achievements
Rank 1
nirmal
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or