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

PreIntialize javascript error

5 Answers 97 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Pooja
Top achievements
Rank 1
Pooja asked on 25 Jan 2012, 02:35 AM
Hi,
I am getting following error in scheduler. 


Message: '0._preInitialized' is null or not an object
Line: 1144
Char: 1
Code: 0
URI: XXX/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2011.3.1115.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3acf16ab29-be3a-4761-9f9e-2c05ea68ff51%3a4c8be21a%3a650fdad%3aef9d9f4a%3aa51ee93e%3a59462f1%3a19620875%3a39040b5c%3af85f9819

This error is intermittent but frequent, I tried reproducing the error in a sample code, but the error is not reproducible there. Few things which might be helpful.
1. I am using the scheduler inside a usercontrol
2. This user control is loaded inside an updatepanel.
3. I am also using RadTooltipManager to show tooltips for appointment 
4. The user control has radajaxmanagerproxy which update the scheduler and tooltipmanager
5. This error usually comes when I try to navigate between views.

  The axd script which throws error is 

b.RadScheduler._preInitialize=function(p,o,m,k,l){var n=d("#"+p);
if(n[0]._preInitialized&&!$telerik.isIE){return;
}
Please let me know if this is a known issue or at least what this script is trying to do

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Jan 2012, 10:40 AM
Hello Pooja,

Check the following forum thread which discussed similar scenario.
Java Error on Scheduler

-Shinu.
0
Pooja
Top achievements
Rank 1
answered on 26 Jan 2012, 01:48 AM
I applied the registerscript solution, but it is still giving me the error.

 I don't think problem is with any missing javascript, problem is in the line
if(n[0]._preInitialized&&!$telerik.isIE){return;
} 

while debugging I got "n" as calendar control but n[0] was undefined. While navigating before going to sever, it is making this javascript call, any idea on this.
0
Kalina
Telerik team
answered on 30 Jan 2012, 04:11 PM
Hi Pooja,

In fact, SharePoint has issues when the RadAjaxManager is declared at markup in a user control.

Let me suggest you overcome this by adding the RadAjaxManager at OnInit event of the web part.
Additionally please add the AjaxSettings in this manner:

private const string _ascxPath = @"~/_CONTROLTEMPLATES/SchedulerWebPartProject/SchedulerWebPart/VisualWebPart1UserControl.ascx";
  
protected override void CreateChildControls()
{
}
  
RadAjaxManager ajaxmgr;
protected override void OnInit(EventArgs e)
{
  
    base.OnInit(e);
  
    ajaxmgr = new RadAjaxManager();
    Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
    Page.Form.Controls.AddAt(0, ajaxmgr);
  
}
  
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
  
    Control control = Page.LoadControl(_ascxPath);
    Controls.Add(control);
  
    RadCalendar calendar = control.FindControl("RadCalendar1") as RadCalendar;
    RadScheduler scheduler = control.FindControl("RadScheduler1") as RadScheduler;
  
    ajaxmgr.AjaxSettings.AddAjaxSetting(calendar, scheduler);
}

The code above is quite simplified – one RadCalendar updates one  RadScheduler  - but I believe it illustrates the approach properly.
In case the issue persists - please provide us more details about your implementation.

Regards,
Kalina
the Telerik team
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 their blog feed now
0
Pooja
Top achievements
Rank 1
answered on 01 Feb 2012, 12:53 PM
Hi Kalina,

My issue is not related to sharepoint, it is more related to dynamically loading a user control(say scheduler control) in the page. This user control contains scheduler, first time when schedulercontrol is loaded scheduler is working fine, on some other event I am reloading the schedulercontrol, then when I navigate between views, I am getting that javascript error.
0
Peter
Telerik team
answered on 01 Feb 2012, 01:05 PM
Hi,

Can you try to isolate the problem further by removing separately RadToolTipManager and RadAjaxProxy and test if the error is still reproducible?

Kind regards,
Peter
the Telerik team
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 their blog feed now
Tags
Scheduler
Asked by
Pooja
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pooja
Top achievements
Rank 1
Kalina
Telerik team
Peter
Telerik team
Share this question
or