In case QuickEventDialog window is set to false (calendar.setShowQuickEventDialog(false);) there is a JS error when adding custom fields to EventEditor(calendar.setEventEditorFields(nameText,selectItem,statusRadio,descItem);).
This JS error is resulted when an addevent operation is triggered on calendar widget.
we are using SmartGWT 3.0.
Code Snippet to reproduce the issue :
The above code is same as given in showcase just that the quickEventDailog is set to false. Please try to add an event on calendar now.
We have debugged the issue and found that in ISC_Calendar.js there is a check for customfields if they part of quickEventDailog, Since at this point the QuickEventDailog is null it results in a JS error.
This can be reproduced on IE 8.
Please find the error trace below :
13:45:59.660 [ERROR] [ABC] 13:45:59.644:MUP5:WARN:Log:Error:
''undefined' is null or not an object'
in http://127.0.0.1:8888/ABC/sc/modules/ISC_Calendar.js
at line 123
[a]DynamicForm.setCustomValues(_36=>undef)
Calendar.$53j(_1=>null)
[o]Window.show()
Calendar.$53l(_1=>21, _2=>3, _3=>1, _4=>undef)
DaySchedule.cellMouseUp(_1=>Obj, _2=>21, _3=>3)
[a]GridBody.cellMouseUp(record=>Obj, rowNum=>21, colNum=>3)
GridRenderer.mouseUp(Obj, null)
[a]MathFunction.invokeSuper(_1=>null, _2=>"mouseUp", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
[a]MathFunction.Super(_1=>"mouseUp", _2=>Obj{length:2}, _3=>undef)
GridBody.mouseUp(Obj, null)
Canvas.handleMouseUp(_1=>Obj, _2=>null)
[c]EventHandler.bubbleEvent(_1=>[GridBody ID:isc_Calendar_0_weekView_body], _2=>"mouseUp", _3=>null, _4=>false)
[c]EventHandler.$k5(_1=>[object Event], _2=>undef)
[c]EventHandler.handleMouseUp(_1=>[object Event], _2=>undef)
[c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object Event])
anonymous(event=>undef)
"if (!isc.Browser.isIE && event == null) return;var returnVal=arguments.callee.$ch.isc.EH.dispatch(arguments.callee.$j2,event);return returnVal;"
com.smartgwt.client.core.JsObject$SGWT_WARN: 13:45:59.644:MUP5:WARN:Log:Error:
''undefined' is null or not an object'
in http://127.0.0.1:8888/AEP/sc/modules/ISC_Calendar.js
at line 123
[a]DynamicForm.setCustomValues(_36=>undef)
Calendar.$53j(_1=>null)
[o]Window.show()
Calendar.$53l(_1=>21, _2=>3, _3=>1, _4=>undef)
DaySchedule.cellMouseUp(_1=>Obj, _2=>21, _3=>3)
[a]GridBody.cellMouseUp(record=>Obj, rowNum=>21, colNum=>3)
GridRenderer.mouseUp(Obj, null)
[a]MathFunction.invokeSuper(_1=>null, _2=>"mouseUp", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
[a]MathFunction.Super(_1=>"mouseUp", _2=>Obj{length:2}, _3=>undef)
GridBody.mouseUp(Obj, null)
Canvas.handleMouseUp(_1=>Obj, _2=>null)
[c]EventHandler.bubbleEvent(_1=>[GridBody ID:isc_Calendar_0_weekView_body], _2=>"mouseUp", _3=>null, _4=>false)
[c]EventHandler.$k5(_1=>[object Event], _2=>undef)
[c]EventHandler.handleMouseUp(_1=>[object Event], _2=>undef)
[c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object Event])
anonymous(event=>undef)
"if (!isc.Browser.isIE && event == null) return;var returnVal=arguments.callee.$ch.isc.EH.dispatch(arguments.callee.$j2,event);return returnVal;"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source)
This JS error is resulted when an addevent operation is triggered on calendar widget.
we are using SmartGWT 3.0.
Code Snippet to reproduce the issue :
Code:
Calendar calendar = new Calendar(); calendar.setShowQuickEventDialog(false); //specify the last field from the default fields so that subsequent fields come after the //default fields TextItem descItem = new TextItem(); descItem.setName("description"); //custom fields below HeaderItem eventOptions = new HeaderItem(); eventOptions.setDefaultValue("Event Options"); SelectItem repeatsItem = new SelectItem(); repeatsItem.setName("repeats"); repeatsItem.setTitle("Repeats"); repeatsItem.setColSpan(4); repeatsItem.setDefaultToFirstOption(true); repeatsItem.setValueMap("Does not repeat", "Daily", "Weekly", "Monthly", "Yearly"); SelectItem reminderItem = new SelectItem(); reminderItem.setName("reminderType"); reminderItem.setTitle("Reminder"); reminderItem.setWidth(70); reminderItem.setDefaultToFirstOption(true); reminderItem.setValueMap("Pop-up", "Email"); TextItem reminderValue = new TextItem(); reminderValue.setName("reminderValue"); reminderValue.setShowTitle(false); reminderValue.setWidth(60); reminderValue.setDefaultValue(10); SelectItem reminderUnits = new SelectItem(); reminderUnits.setName("reminderUnits"); reminderUnits.setShowTitle(false); reminderUnits.setWidth(70); reminderUnits.setDefaultToFirstOption(false); reminderUnits.setValueMap("minutes", "hours", "days"); calendar.setEventEditorFields(descItem, eventOptions, repeatsItem, reminderItem, reminderValue, reminderUnits); calendar.draw();
We have debugged the issue and found that in ISC_Calendar.js there is a check for customfields if they part of quickEventDailog, Since at this point the QuickEventDailog is null it results in a JS error.
This can be reproduced on IE 8.
Please find the error trace below :
13:45:59.660 [ERROR] [ABC] 13:45:59.644:MUP5:WARN:Log:Error:
''undefined' is null or not an object'
in http://127.0.0.1:8888/ABC/sc/modules/ISC_Calendar.js
at line 123
[a]DynamicForm.setCustomValues(_36=>undef)
Calendar.$53j(_1=>null)
[o]Window.show()
Calendar.$53l(_1=>21, _2=>3, _3=>1, _4=>undef)
DaySchedule.cellMouseUp(_1=>Obj, _2=>21, _3=>3)
[a]GridBody.cellMouseUp(record=>Obj, rowNum=>21, colNum=>3)
GridRenderer.mouseUp(Obj, null)
[a]MathFunction.invokeSuper(_1=>null, _2=>"mouseUp", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
[a]MathFunction.Super(_1=>"mouseUp", _2=>Obj{length:2}, _3=>undef)
GridBody.mouseUp(Obj, null)
Canvas.handleMouseUp(_1=>Obj, _2=>null)
[c]EventHandler.bubbleEvent(_1=>[GridBody ID:isc_Calendar_0_weekView_body], _2=>"mouseUp", _3=>null, _4=>false)
[c]EventHandler.$k5(_1=>[object Event], _2=>undef)
[c]EventHandler.handleMouseUp(_1=>[object Event], _2=>undef)
[c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object Event])
anonymous(event=>undef)
"if (!isc.Browser.isIE && event == null) return;var returnVal=arguments.callee.$ch.isc.EH.dispatch(arguments.callee.$j2,event);return returnVal;"
com.smartgwt.client.core.JsObject$SGWT_WARN: 13:45:59.644:MUP5:WARN:Log:Error:
''undefined' is null or not an object'
in http://127.0.0.1:8888/AEP/sc/modules/ISC_Calendar.js
at line 123
[a]DynamicForm.setCustomValues(_36=>undef)
Calendar.$53j(_1=>null)
[o]Window.show()
Calendar.$53l(_1=>21, _2=>3, _3=>1, _4=>undef)
DaySchedule.cellMouseUp(_1=>Obj, _2=>21, _3=>3)
[a]GridBody.cellMouseUp(record=>Obj, rowNum=>21, colNum=>3)
GridRenderer.mouseUp(Obj, null)
[a]MathFunction.invokeSuper(_1=>null, _2=>"mouseUp", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
[a]MathFunction.Super(_1=>"mouseUp", _2=>Obj{length:2}, _3=>undef)
GridBody.mouseUp(Obj, null)
Canvas.handleMouseUp(_1=>Obj, _2=>null)
[c]EventHandler.bubbleEvent(_1=>[GridBody ID:isc_Calendar_0_weekView_body], _2=>"mouseUp", _3=>null, _4=>false)
[c]EventHandler.$k5(_1=>[object Event], _2=>undef)
[c]EventHandler.handleMouseUp(_1=>[object Event], _2=>undef)
[c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>[object Event])
anonymous(event=>undef)
"if (!isc.Browser.isIE && event == null) return;var returnVal=arguments.callee.$ch.isc.EH.dispatch(arguments.callee.$j2,event);return returnVal;"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source)
Comment