1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / RadWindow and RadDatePicker causing javascript error.

RadWindow and RadDatePicker causing javascript error.

9 posts, 0 answered
  1. rmoynihan
    rmoynihan avatar
    18 posts
    Registered:
    28 May 2007
    10 Jul 2008
    Link to this post
    Hi,

    When I use a RadWindow and RadDatePicker on the same page I get the following javascript error and neither controls work on the page. I am using sitefinity 3.2 sp2.

    missing : after property id
    "HH:mm","yyyy\'-\'MM\'-\'dd\'T\'HH\':\'m...07c4-19d6-428a-a7a8-7817717a1fbd_DateTex

    Any ideas,

    Thanks,

    Ronan
  2. rmoynihan
    rmoynihan avatar
    18 posts
    Registered:
    28 May 2007
    10 Jul 2008
    Link to this post
    Hi,

    I am also getting a javascript error from the raddatepicker when it is in an update panel.

    Sys.InvalidOperationException: Component 'ctl00_ContentPlaceHolder1_contolPanel_MediaSpaceCRUD1_edb7a097-fe49-4da4-85bc-36958c24c9b7_DateTextBox_calendar' was not found.
     if (!reference) throw Error.inva...s.referenceNotFound, references[name]));

    I have tried updating the Telerik.Web.UI.dll to the latest version 2008.1.619.35 but this does not resolve the error. Are there other dll's whicj I need to update.

    Thanks,

    Ronan
  3. rmoynihan
    rmoynihan avatar
    18 posts
    Registered:
    28 May 2007
    10 Jul 2008
    Link to this post
    There is another problem with the RadWindow in an update panel,

    I have the following error after the radwindow is closed when I try to call a function,

    CallBackFunction is not defined

    This is the code in the code behind class. The callbackfunction is called when its not in an update panel

    protected override void OnPreRender(EventArgs e)

    {

            base.OnPreRender(e);

                if (this.Page != null)

                {

                    this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "callback", this.GetScript(),true);

                }

    }


    private string GetScript()

    {

    string result = "function CallBackFunction(radWindow, returnValue)" +

    "{" +

    "var oArea = document.getElementById('" + "ItemsPanel_" + this.ThumbnailTextBox.ClientID + "');" +

    "if (returnValue) oArea.value = returnValue.src;" +

    "}";

    return result;

    }




  4. rmoynihan
    rmoynihan avatar
    18 posts
    Registered:
    28 May 2007
    10 Jul 2008
    Link to this post
    Sorry the getscript method is like this

    private string GetScript()

    {

    string result = "function CallBackFunction(radWindow, returnValue)" +

    "{" +

    "var oArea = document.getElementById('" + this.ThumbnailTextBox.ClientID + "');" +

    "if (returnValue) oArea.value = returnValue.src;" +

    "}";

    return result;

    }

  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    11 Jul 2008
    Link to this post
    Hi rmoynihan,

    1. RadDatePicker issue
    The reason for the described behavior is that the Client ID of the RadDatePicker control is not valid. Here is its value:

    ctl00_ContentPlaceHolder1_contolPanel_MediaSpaceCRUD1_edb7a097-fe49-4da4-85bc-36958c24c9b7_DateTextBox_calendar

    As you see,
    the client id contains a Guid (edb7a097-fe49-4da4-85bc-36958c24c9b7) in it. In fact, the dashes (-) are invalid characters and break the picker javascript.

    2. "CallBackFunction is not defined" issue
    Please send us a full example that demonstrate the problem and we will debug the issue locally.

    Also, I would recommend you use RadAjax (RadAjaxPanel or RadAjaxManager ) to "ajaxify" controls instead of the ASP.NET UpdatePanel.

    Thanks for your cooperation in advance.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. rmoynihan
    rmoynihan avatar
    18 posts
    Registered:
    28 May 2007
    13 Jul 2008
    Link to this post

    Hi,

    Removing the dashes from the Control ID fixed the problem for the Datepicker, thanks.

    For the other problem with the RadWindow, I have added a RadAjaxPanel and RadAjaxManager to the page. There is now no javascript error on the page but when I click on the link that opens the RadWindow nothing happens.

    If there is a full postback caused by another control then it works.

    I think the problem is because the RadWindow is a part of a user control that is added to the page dynamically  and the script does not appear to be added to the page.

    I have sent a zip folder with 3 user controls using My client.net.

    These are as follows,
    MediaSpaceCRUD.ascx - This is the main control with 2 buttons. These 2 buttons will dynamically add the other controls ImageItem.ascx and EventsNewsItem.ascx to the page. An ImageItem will be added to the page using ajax and when it is added clicking on the select link does nothing, but if add a EventsNewsItem to the page this will cause a full postback and then clicking on the select link will open the RadWindow.

    There is an App_Code folder containing a DataContext class and an App_Data folder containg  a sql script to create 2 tables which the controls use.

    Thanks,

    Ronan

  7. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    15 Jul 2008
    Link to this post
    Hello ronan,

    We would highly appreciate it if you continue our discussion in the support ticket opened on the same topic.

    Thanks for your cooperation in advance.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. cristi
    cristi avatar
    1 posts
    Registered:
    07 Mar 2009
    07 Mar 2009
    Link to this post
    Hi,

    I am having the same issue with the Date Picker when inside a Grid in a user control loaded dynamically.

    Did you guys find a solution?

    Thanks,
    Cristi
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    07 Mar 2009
    Link to this post
    Hi cristi,

    Try registering your client script through ScriptManager as the example below:

    protected override void OnPreRender(EventArgs e)  
        {  
            base.OnPreRender(e);  
            if (this.Page != null)  
            {  
                ScriptManager.RegisterClientScriptBlock();  
            }  
        } 

    Regards,
    Ivan Dimitrov
    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.
Register for webinar
9 posts, 0 answered