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

Receiving "Object required" Error When User Changes Combobox Selection

10 Answers 101 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
jgill
Top achievements
Rank 1
jgill asked on 01 Dec 2010, 03:23 AM
Hello,
I am receiving a strange error when a user changes their RadCombobox selection more than once.  I have a user control that contains the RadComboBox and a label that is then placed inside of RadAjax panel then depending on the user's selection I hide and show other controls.  An issue is occuring after a user does the following:
1 - They can change the drop down selection once without an issue
2 - When they change the drop down selection a second time a JavaScript error occurs


Message: Object required
Line: 292
Char: 28
Code: 0
URI: https://secure.site.com/ScriptResource.axd?d=5ut_6SXy3r9CJ2AeDds-Izp-Bg0U7_3Wu8lOt1YeQI50q7gpperlCnkV19Nk2WLlaKx9WcQKWlUj5uVQFKbhmULObFseGkumXegL3O_oU1SM3Cc7S_2xpMbRUtFsca8OdmLluHRcPbmjWamXmckZiisXYrLQhE6PANVGzpcMFMD3OhJj0&t=634078171387790179

The script resource does exist, when I copy and paste the real URL content comes back:
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadInputComponent=function(){Telerik.Web.UI.RadInputComponent.initializeBase(this);
this._inputs=new Array();
this._radInputExtender=null;
this._emptyMessage="";
this._errorMessage="";
this._emptyMessageCss="RadInputMgr_Default RadInput_Empty_Default";
this._readOnlyCss="RadInputMgr_Default RadInput_Read_Default";
this._invalidCss="RadInputMgr_Default RadInput_Error_Default";
this._hoveredCss="RadInputMgr_Default RadInput_Hover_Default";
this._enabledCss="RadInputMgr_Default RadInput_Enabled_Default";
this._focusedCss="RadInputMgr_Default RadInput_Focused_Default";
this._disabledCss="RadInputMgr_Default RadInput_Disabled_Default";
this._selectionOnFocus=Telerik.Web.UI.SelectionOnFocus.CaretToEnd;
this._targetControlIDs=null;
this._initializeOnClient=false;
this._isRequired=false;
this._validationGroup="";
this._validateOnEvent=2;
this._location="";
this._method="";
this._onTextBoxKeyPressDelegate=null;
this._onTextBoxBlurDelegate=null;
this._onTextBoxFocusDelegate=null;
this._onTextBoxMouseOutDelegate=null;
this._onTextBoxMouseOverDelegate=null
};
Telerik.Web.UI.RadInputComponent.prototype={initialize:function(){Telerik.Web.UI.RadInputComponent.callBaseMethod(this,"initialize");
var a;
...etc.

10 Answers, 1 is accepted

Sort by
0
jgill
Top achievements
Rank 1
answered on 02 Dec 2010, 03:05 AM
The error is occuring on the line below, which happens to be line 292 in the autogenerated ScriptResource.axd.  Firebug is saying that the value for "a is null" after I change the selected index twice.

if(typeof(b)=="undefined"){c=a.value
}else{c=b
0
jgill
Top achievements
Rank 1
answered on 04 Dec 2010, 10:57 PM
This is very indeed becoming very strange.  The error is occuring when the Telerik control resources load, but may be related to AJAX usage.

a is null
updateValue(Object { name="b"})Script...0000000 (line 292)
_beforeSubmit()Script...0000000 (line 370)
_beforeSubmit(Object { name="b"})Script...0000000 (line 418)
_onSubmit()Script...0000000 (line 414)
WebForm_OnSubmit()Script...0000000 (line 429)
(?)()Script...0157904 (line 50)
eval()Script...seq/233 (line 1)
evalStr(Object { name="str"})Script...0000000 (line 806)
postback(Object { name="b"})Script...0000000 (line 843)
_select(Object { name="f"})Script...0000000 (line 1358)
_onDropDownClick(Object { name="c"})Script...0000000 (line 470)
(?)()Script...0157904 (line 50)
browserHandler(Object { name="e"})Script...0157904 (line 3034)
0
Simon
Telerik team
answered on 08 Dec 2010, 10:05 AM
Hi jgill,

Indeed the stack trace shows that the error occurs just before the form is submitted with AJAX.

Since we have not encountered such an issue before, can you please provide a live URL where the error can be reproduced?

Greetings,
Simon
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
jgill
Top achievements
Rank 1
answered on 08 Dec 2010, 01:30 PM
Simon,
How would I obtain the trace for the info needed?

Also it seems that the page is including a large number of linked files, e.g. ScriptResource.axd, WebResource.axd, etc. and the drop down behaves fine when there are very few other Radcontrols on the page.  When the number of controls increases the number of times the user can change the selected index of the drop down before the JavaScript error occurs varies.  Is there an upper limit on the number of ScriptResource.axd, etc. files that can be included on a page before an error occurs?
0
Simon
Telerik team
answered on 08 Dec 2010, 04:42 PM
Hello jgill,

What you have pasted in your last message is the stack trace, however the functions are obfuscated and they do not give much useful information.

In response to your second question, there is no limit of the number of JavaScript files that your browser can load. On the other hand, the number of files is unlikely to be related to the error.

Can you please try disabling AJAX to see whether the error still appears afterwards?

All the best,
Simon
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
jgill
Top achievements
Rank 1
answered on 09 Dec 2010, 04:09 PM
When I disable AJAX on the RadScriptManager I still receive the error after changing the drop down selection (the ASP.NET AJAX Manager is still on the page, I just disabled AJAX in the RadScriptManager.  Here is as close as I could get to a stack track (using the output from console in Firebug) without pasting all the JavaScript from the ScriptResource.axd.  The error is occuring on:

if(typeof(b)=="undefined"){c=a.value



updateValue(Object { name="b"})Script...0000000 (line 292)
      if(typeof(b)=="undefined"){c=a.value

_updateCssClassOnInitialize(Object { name="a"})Script...0000000 (line 770)
     _updateValueOnInitialize:function(a){this.get_targetInput(a).updateValue()

initialize()Script...0000000 (line 34)
     this._updateValueOnInitialize(b[a]);

Type$callBaseMethod(Object { name="instance"}, Object { name="name"}, Object { name="baseArguments"})Script...0157904 (line 508)
     return baseMethod.apply(instance);

dispose()Script...0000000 (line 736)
     Telerik.Web.UI.RadRegExpTextBoxComponent.prototype={initialize:function(){Telerik.Web.UI.RadRegExpTextBoxComponent.callBaseMethod(this,"initialize")
737},dispose:function(){Telerik.Web.UI.RadRegExpTextBoxComponent.callBaseMethod(this,"dispose")

Sys$Component$endUpdate()Script...0157904 (line 2702)
     if (!this._initialized) this.initialize();
Sys$Component$create(Object { name="type"}, Object { name="properties"}, Object { name="events"}, Object { name="references"}, Object { name="element"})Script...0157904 (line 2856)
     component.endUpdate();

(?)()form.aspx?id=3 (line 578)
     $create(Telerik.Web.UI.RadRegExpTextBoxComponent, {"disabledCss":"RadInputMgr_Office2007 RadInput_Disabled_Office2007 RadInputMgr_Office2007 ","emptyMessageCss":"RadInputMgr_Office2007 RadInput_Empty_Office2007 RadInputMgr_Office2007 ","enabledCss":"RadInputMgr_Office2007 RadInput_Enabled_Office2007 RadInputMgr_Office2007 ","errorMessage":"Please enter in the format MM/YYYY","focusedCss":"RadInputMgr_Office2007 RadInput_Focused_Office2007 RadInputMgr_Office2007 ","hoveredCss":"RadInputMgr_Office2007 RadInput_Hover_Office2007 RadInputMgr_Office2007 ","id":"ctl00_ContentPlaceHolder1_InputManager_1","invalidCss":"RadInputMgr_Office2007 RadInput_Error_Office2007 RadInputMgr_Office2007 ","readOnlyCss":"RadInputMgr_Office2007 RadInput_Read_Office2007 RadInputMgr_Office2007 ","targetControlIDs":["ctl00_ContentPlaceHolder1_dq371_dqAnswer"],"validationExpression":"\\d{2}/\\d{4}"}, null, null);
579});

_handler(Object { name="source"}, Object { name="args"})Script...0157904 (line 2503)
     evt[i](source, args);

Sys$_Application$_doInitialize()Script...0157904 (line 3792)
     handler(this, Sys.EventArgs.Empty);

(?)()Script...0157904 (line 50)
     return method.apply(instance, arguments);

[Break on this error] if(typeof(b)=="undefined"){c=a.value
Script...0000000 (line 292)
      Telerik.Web.UI.RadInputExtender.prototype={isEmpty:function(){var a=$get(this._id);
266if(a.value&&(a.value==this._owner.get_emptyMessage()||a.value==this._owner.get_errorMessage())){return true
267}else{if(!a.value){return true
268}}return false
269},get_id:function(){return this._id
270},get_owner:function(){return this._owner
271},get_value:function(){var a=$get(this._id);
272if(this._owner._inputs[this._id]._focused){return this.parseValue(a.value)
273}else{if(this.isEmpty()){return""
274}else{return this.parseValue(a.value)
275}}},set_value:function(a){this._owner._inputs[this._id]._invalid=false;
276this.updateValue(a);
277if(this._owner.get_validateOnEvent()!=1||this._owner._inputs[this._id]._invalid){this._owner.isValid(this._id)
278}this.updateCssClass()
279},updateCssClass:function(){var b=$get(this._id);
280var a=b.className;
281if((!this._isEmptyMessage())&&(!this.isNegative())){a=this._owner.get_enabledCss()
282}if((!this._isEmptyMessage())&&this.isNegative()){a=this._owner.get_negativeCss()
283}if(this._isEmptyMessage()){a=this._owner.get_emptyMessageCss()
284}if(this._owner._inputs[this._id]._hovered){a=this._owner.get_hoveredCss()
285}if(this._owner._inputs[this._id]._focused){a=this._owner.get_focusedCss()
286}if(this._owner._inputs[this._id]._invalid){a=this._owner.get_invalidCss()
287}if(b.readOnly){a=this._owner.get_readOnlyCss()
288}if(b.disabled){a=this._owner.get_disabledCss()
289}b.className=a
290},updateValue:function(b){var a=$get(this._id);
291var c;
292if(typeof(b)=="undefined"){c=a.value
293}else{c=b
0
Simon
Telerik team
answered on 12 Dec 2010, 04:37 PM
Hi jgill,

Thank you for the additional info.

All the code shown until now is of a RadInput control. Why RadComboBox triggers this error is still unknown. I will need to reproduce the bug and investigate it.

Can you please remove as many controls and as much markup from the page as possible and leave only the required minimum to reproduce the error and then paste here the code?

Best wishes,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
jgill
Top achievements
Rank 1
answered on 13 Dec 2010, 12:55 AM
Thank you for pointing out that it's related to the RadInput controls.  I believe it's related to some validation input settings on some of the controls.  When the controls and hidden or shown again in a placeholder that is ajaxified, it's potentially trying to do something with the validations.  When I comment out the code that dynamically adds the validators to the controls the error is not occurring.  I will investigate more, but this is looking like the reason.  Thank you for your help!
0
Simon
Telerik team
answered on 13 Dec 2010, 09:37 AM
Hello jgill,

Please let me know when you find the cause or anything suspicious that may originate in our code.

All the best,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
jgill
Top achievements
Rank 1
answered on 13 Dec 2010, 07:01 PM
Hello Simon,
This issue is certainly related to the input validations that can be applied to RadInput controls through the input setting.  I will try to put together a sample that can recreate the issue and post it or a link to it here.

The scenario I have is:
  • Master Page w/ RadAjax Manager
    • Content Page w/ RadAjax Manager Proxy and RadInputManager
      • Dynamic user controls are added to the page in the Init event
      • Dynamic RadInput manager settings (e.g. like RegExSetting are added to controls dynamically, also in the Page's Init event)
      • When the user changes the value in one of the input controls logic is fired, a loading panel displays, etc.
        • Example: User changes the selection in a RadComboBox, then controls and hidden and shown.  Depending on which controls are hidden or shown then RadInputSettings could be added for that control (e.g. a control that asks for date input is set to display so RadInputSetting validates around the lower and upper bounds for the date are loaded)

I can get the error to occur only when I have some control with an input validation on it and I change the RadComboBox selected index to make some controls be hidden or shown.  If I remove the code that adds the Rad Input settings I can never get the JavaScript error to occur.

Master Page

<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">
</asp:ScriptManager>
<telerik:RadAjaxManager ID="AjaxManager1" runat="server" >
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" >
</telerik:RadAjaxLoadingPanel>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All"/>

Content Page
<telerik:RadInputManager ID="InputManager" runat="server">
</telerik:RadInputManager>
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy" runat="server">
<AjaxSettings>
<%-- If I add the Input Manager to the list of controls "ajaxified" I get a viewstate error
<telerik:AjaxSetting AjaxControlID="InputManager">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="ControlArea" LoadingPanelID="LoadingPanel" />
                       <telerik:AjaxUpdatedControl ControlID="InputManager" LoadingPanelID="LoadingPanel" />
                   </UpdatedControls>
               </telerik:AjaxSetting>--%>
               <telerik:AjaxSetting AjaxControlID="ControlArea">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="ControlArea" LoadingPanelID="LoadingPanel" />
                       <telerik:AjaxUpdatedControl ControlID="Save" />
                   </UpdatedControls>
               </telerik:AjaxSetting>
           </AjaxSettings>
</telerik:RadAjaxManagerProxy>
Tags
ComboBox
Asked by
jgill
Top achievements
Rank 1
Answers by
jgill
Top achievements
Rank 1
Simon
Telerik team
Share this question
or