get_argument not supported

8 posts, 0 answers
  1. Andy
    Andy avatar
    25 posts
    Member since:
    Nov 2008

    Posted 17 Apr 2009 Link to this post

    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
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 17 Apr 2009 Link to this post

    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.
  3. Robert Vreeland
    Robert Vreeland avatar
    18 posts
    Member since:
    Nov 2007

    Posted 05 Jun 2009 Link to this post

    Was get-arguments made available first in the 2009 version or earlier?
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 08 Jun 2009 Link to this post

    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.
  5. nirmal
    nirmal avatar
    11 posts
    Member since:
    May 2009

    Posted 13 Aug 2009 Link to this post

    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
  6. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 13 Aug 2009 Link to this post

    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.
  7. nirmal
    nirmal avatar
    11 posts
    Member since:
    May 2009

    Posted 18 Aug 2009 Link to this post

    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
  8. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 20 Aug 2009 Link to this post

    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.
Back to Top