Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Error adding new event to calendar

    Smart GWT 4.1d (2014-01-27)

    Had no problem with this call (4.0p for long time):
    Code:
    ...						
    calendar.showNewEventDialog(newEvent);
    But now trying the 4.1d getting this error:

    Code:
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.calendar.Calendar::showNewEventDialog(Lcom/smartgwt/client/widgets/calendar/CalendarEvent;)([Java object: com.smartgwt.client.widgets.calendar.CalendarEvent@2087407895]): Unable to get property 'firstChild' of undefined or null reference
    	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
    	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
    	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    	at com.smartgwt.client.widgets.calendar.Calendar.showNewEventDialog(Calendar.java)
    Code:
    Exception caught: (TypeError) description: Unable to get property 'firstChild' of undefined or null reference number: -2146823281 stack: TypeError: Unable to get property 'firstChild' of undefined or null reference at isc_CanvasItem_placeCanvas (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Forms.js:1300:155) at isc_CanvasItem_moved (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Forms.js:1303:767) at isc_DynamicForm_itemsMoved (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Forms.js:281:1013) at isc_DynamicForm_handleParentMoved (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Forms.js:281:514) at isc_Canvas__fireParentMoved (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Core.js:2096:410) at isc_Canvas_handleParentMoved (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Core.js:2096:244) at isc_Canvas__fireParentMoved (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Core.js:2096:410) at isc_Canvas__completeMoveBy (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Core.js:2093:353) at isc_Canvas_moveBy (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Core.js:2093:199) at isc_Canvas_moveTo (http://localhost:8081/amkailink/amkailink/sc/modules/ISC_Core.js:2116:94): Unable to get property 'firstChild' of undefined or null reference
    
    ( com.google.gwt.event.shared.UmbrellaException )
    Hope you can fix it easily from the stack trace, so I don't need to create a minimized source code to duplicate it.

    Thank you.

    #2
    We aren't seeing this - can you post the code definition of the event you're passing to the method?

    Comment


      #3
      Example to repeat the problem

      Smart GWT 4.1d (2014-02-02)

      Here is the source code,
      Code:
      import java.util.ArrayList;
      import java.util.Date;
      import java.util.List;
      
      import com.google.gwt.core.client.EntryPoint;
      import com.smartgwt.client.types.TimeDisplayFormat;
      import com.smartgwt.client.util.DateUtil;
      import com.smartgwt.client.widgets.calendar.Calendar;
      import com.smartgwt.client.widgets.calendar.CalendarEvent;
      import com.smartgwt.client.widgets.calendar.events.CalendarEventClick;
      import com.smartgwt.client.widgets.calendar.events.EventClickHandler;
      import com.smartgwt.client.widgets.form.fields.TextItem;
      import com.smartgwt.client.widgets.layout.VLayout;
      
      public class TestErrorAddingNewEventToCalendar implements EntryPoint {
      	
      	private static Date today = new Date();   
      	private static int year = today.getYear();   
      	private static int month = today.getMonth();   
      	private static int day = today.getDate() - today.getDay() +2;
      	
      	private Calendar calendar;
      
      	@Override
      	public void onModuleLoad() {
      		DateUtil.setWeekendDays(new Integer[]{0});
      		
      		VLayout vl = new VLayout();
      				
      		calendar = new Calendar();
      		
      		calendar.setRowHeight(40);
          	calendar.setTimeFormatter(TimeDisplayFormat.TOSHORTTIME);
      		
      		calendar.setWorkdayStart("6:00am");
      		calendar.setWorkdayEnd("8:00pm");
      
      		calendar.setShowWeekends(false);
      		calendar.setWorkdays(new int[]{1,2,3,4,5,6});
      		calendar.setFirstDayOfWeek(1); // Monday
      	    
              calendar.setShowWorkday(true);  
              calendar.setScrollToWorkday(true);
      		calendar.setCanEditEvents(false);
              
      		calendar.setCanCreateEvents(true);
      		calendar.setCanRemoveEvents(false);
      		
      		calendar.setCanDragEvents(false);
      		calendar.setCanDrop(false);
      		calendar.setSaveButtonTitle("Start Request");
      		calendar.setEventOverlap(true);
      		calendar.setEventOverlapPercent(80);
      		calendar.setEventOverlapIdenticalStartTimes(true);
          	calendar.setEventSnapGap(15);
          	
      		calendar.setEventNameFieldTitle("Request Comment");
      		
              TextItem tiName = new TextItem();   
              tiName.setType("text");   
              tiName.setName("name");
              tiName.setTitle("Name title");
      
      		calendar.addEventClickHandler(new EventClickHandler() {
      			
      			@Override
      			public void onEventClick(CalendarEventClick event) {
      				System.out.println("clicked on event: " + event.getEvent().getEventId());
      				CalendarEvent newEvent = new CalendarEvent();
      				newEvent.setLane(event.getEvent().getLane());
      				
      				newEvent.setStartDate(calendar.getDateFromPoint());
      				
      				if (newEvent.getEndDate() == null) {
      					long time = newEvent.getStartDate().getTime() + (1000 * 60 * 60); // end time for 1 hour length
      					newEvent.setEndDate(new Date(time));
      				}
      				calendar.showNewEventDialog(newEvent);
      			}
      		});
              
              reloadEvents();
      		
      		vl.setMembers(calendar);
      		vl.setWidth100();
      		vl.setHeight100();
      		vl.draw();
      		
      	}
      	
      	public void reloadEvents() {
      		long t = System.currentTimeMillis();
      		CalendarEvent[] events = getEvents();
      		for(CalendarEvent e : events) {
      			e.setName(e.getName() + " " + e.getEventWindowStyle());
      		}
      		
      		calendar.setData(events);
      		System.out.println("set events: " + (System.currentTimeMillis() - t) + " ms,   count: " + events.length);
      	}
      	
      	public static CalendarEvent[] getEvents() {
      		List<CalendarEvent> eventList = new ArrayList<CalendarEvent>();
      		CalendarEvent event;
      		
      		event = new CalendarEvent(1, "#1", "Test", new Date(year, month, day, 7, 0, 0), new Date(year, month, day, 11, 0, 0));
      		eventList.add(event);
      
      		CalendarEvent[] events = new CalendarEvent[eventList.size()];
      		eventList.toArray(events);		
      		return events;
      	}
      	
      }
      and the steps to repeat:

      1. Click on the event
      2. (New event dialog opens), just click to X to cancel
      3. Click on the event again
      ==> error comes up:
      Code:
      14:53:47.709 [ERROR] [amkailinktest] Uncaught exception escaped
      
      com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) @com.smartgwt.client.widgets.calendar.Calendar::showNewEventDialog(Lcom/smartgwt/client/widgets/calendar/CalendarEvent;)([Java object: com.smartgwt.client.widgets.calendar.CalendarEvent@1512927756]): Unable to get property 'firstChild' of undefined or null reference
          at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
          at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
          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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
          at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
          at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
          at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
          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(Thread.java:724)
      Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.calendar.Calendar::showNewEventDialog(Lcom/smartgwt/client/widgets/calendar/CalendarEvent;)([Java object: com.smartgwt.client.widgets.calendar.CalendarEvent@1512927756]): Unable to get property 'firstChild' of undefined or null reference
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
          at com.smartgwt.client.widgets.calendar.Calendar.showNewEventDialog(Calendar.java)
          at com.amkai.amkailink.web.test.client.TestErrorAddingNewEventToCalendar$2.onEventClick(TestErrorAddingNewEventToCalendar.java:158)
          at com.smartgwt.client.widgets.calendar.events.CalendarEventClick.dispatch(CalendarEventClick.java:108)
          at com.smartgwt.client.widgets.calendar.events.CalendarEventClick.dispatch(CalendarEventClick.java:1)
          at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
          at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
          at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
          at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
          at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
          at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
          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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
          at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
          at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
          at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
          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(Thread.java:724)
      Interesting but it works for the first time, but then we always get the error.

      Please let me know if you need anything else to fix. Thanks.

      Comment


        #4
        We still don't see this issue running against latest 4.1, with your sample.

        However - we do see an underlying bug that is probably responsible, and this has been fixed for tomorrow's build.

        You should be able to test that this fixes your issue by passing some values into your call to getDateFromPoint(). This code should do it:

        Code:
        newEvent.setStartDate(
            calendar.getDateFromPoint(
                calendar.getSelectedView().getOffsetX(),
                calendar.getSelectedView().getOffsetY()
            )
        );
        Last edited by Isomorphic; 4 Feb 2014, 08:25.

        Comment


          #5
          Thanks. Will test with your fix tomorrow.
          Any idea, why the difference? (note, the error comes up only for the second click).

          The suggested code sample doesn't work for me. Please see attached screen shot. Yellow is my original code, but the method getSelectedView() in undefined in yours.

          Thank you.
          Attached Files

          Comment


            #6
            Ah yes, getSelectedView() isn't exposed in 4.1 - for the purposes of testing this fix, you can just directly use getWeekView()/getDayView(), depending on which view you're using.

            Comment


              #7
              Smart GWT 4.1d (2014-02-05)

              Thank you, but it didn't help anything. If I just create an "empty" CalendarEvent it also fails second time calling calendar.showNewEventDialog(newEvent).

              Code:
              		Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
              			
              			private int counter = 1;
              			
              			@Override
              			public boolean execute() {
              				System.out.println("TestErrorAddingNewEventToCalendar.onModuleLoad().new RepeatingCommand() {...}.execute()");
              				CalendarEvent newEvent = new CalendarEvent();
              				newEvent.setName("counter: #" + counter);
              				calendar.showNewEventDialog(newEvent);
              				counter++;
              				return true;
              			}
              		}, 3000);
              This simple code shows the new event dialog with "counter: #1". Click cancel, and the second run (after 3 seconds) creates the error:

              Code:
              14:58:10.809 [ERROR] [amkailinktest] Uncaught exception escaped
              com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) @com.smartgwt.client.widgets.calendar.Calendar::showNewEventDialog(Lcom/smartgwt/client/widgets/calendar/CalendarEvent;)([Java object: com.smartgwt.client.widgets.calendar.CalendarEvent@2023227065]): Unable to get property 'firstChild' of undefined or null reference
                  at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
                  at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:606)
                  at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                  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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
                  at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
                  at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
                  at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
                  at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
                  at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
                  at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:606)
                  at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                  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(Thread.java:724)
              Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.calendar.Calendar::showNewEventDialog(Lcom/smartgwt/client/widgets/calendar/CalendarEvent;)([Java object: com.smartgwt.client.widgets.calendar.CalendarEvent@2023227065]): Unable to get property 'firstChild' of undefined or null reference
                  at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
                  at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
                  at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
                  at com.smartgwt.client.widgets.calendar.Calendar.showNewEventDialog(Calendar.java)
                  at com.amkai.amkailink.web.test.client.TestErrorAddingNewEventToCalendar$1.onEventClick(TestErrorAddingNewEventToCalendar.java:87)
                  at com.smartgwt.client.widgets.calendar.events.CalendarEventClick.dispatch(CalendarEventClick.java:108)
                  at com.smartgwt.client.widgets.calendar.events.CalendarEventClick.dispatch(CalendarEventClick.java:1)
                  at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
                  at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
                  at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
                  at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
                  at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
                  at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:606)
                  at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                  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.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
                  at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
                  at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
                  at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
                  at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
                  at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
                  at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:606)
                  at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                  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(Thread.java:724)
              Please advise. It blocks our upgrade.

              Comment


                #8
                Any update on this? We can't resolve it without your help.

                Comment


                  #9
                  With this code and the latest and various other recent cuts of the code, we are very much struggling to see this issue - we see no errors being output.

                  We do see a *warning* from Element.getOffset(), which we're looking into, but no errors, and your most recent RepeatedCommand() code does, for us, exactly what we would expect, ad infinitum and without error.

                  Are you saying that your application crashes when this error occurs? Or that the dialog doesn't appear the second time, or something else noticeable happens?

                  If so, there must be something else at play - what browsers are you seeing this in? Also, does you code from 4.0 do anything like customization of EventWindow instances or set eventDialogProperties?

                  Comment


                    #10
                    Thank you for all your efforts.

                    We are using IE 11 (Version: 11.0.9600.16476 Update Versions: 11.0.2)

                    Was able to simplify the code, and still getting the error with 4.1d (2014-02-05)
                    Code:
                    import com.google.gwt.core.client.EntryPoint;
                    import com.smartgwt.client.util.SC;
                    import com.smartgwt.client.widgets.calendar.Calendar;
                    
                    public class TestErrorAddingNewEventToCalendar implements EntryPoint {
                    	
                    	@Override
                    	public void onModuleLoad() {
                    		Calendar calendar = new Calendar();
                    		calendar.draw();
                    		SC.showConsole();
                    	}
                    }
                    Steps to repeat: click on the grid for new event, and it will fail by the second time:
                    Code:
                    11:53:05.453 [ERROR] [smartgwttest] 11:53:05.452:MUP6:WARN:Log:TypeError: Unable to get property 'firstChild' of undefined or null reference
                    Stack from error.stack:
                        CanvasItem.placeCanvas () @ smartgwttest/sc/modules/ISC_Forms.js:1301:155
                        CanvasItem.moved () @ smartgwttest/sc/modules/ISC_Forms.js:1304:767
                        DynamicForm.itemsMoved () @ smartgwttest/sc/modules/ISC_Forms.js:281:1013
                        DynamicForm.handleParentMoved () @ smartgwttest/sc/modules/ISC_Forms.js:281:514
                        Canvas._fireParentMoved () @ smartgwttest/sc/modules/ISC_Core.js:2096:410
                        Canvas.handleParentMoved () @ smartgwttest/sc/modules/ISC_Core.js:2096:244
                        Canvas._fireParentMoved () @ smartgwttest/sc/modules/ISC_Core.js:2096:410
                        Canvas._completeMoveBy () @ smartgwttest/sc/modules/ISC_Core.js:2093:353
                        Canvas.moveBy () @ smartgwttest/sc/modules/ISC_Core.js:2093:199
                        Canvas.moveTo () @ smartgwttest/sc/modules/ISC_Core.js:2116:94
                    com.smartgwt.client.core.JsObject$SGWT_WARN: 11:53:05.452:MUP6:WARN:Log:TypeError: Unable to get property 'firstChild' of undefined or null reference
                    Stack from error.stack:
                        CanvasItem.placeCanvas () @ smartgwttest/sc/modules/ISC_Forms.js:1301:155
                        CanvasItem.moved () @ smartgwttest/sc/modules/ISC_Forms.js:1304:767
                        DynamicForm.itemsMoved () @ smartgwttest/sc/modules/ISC_Forms.js:281:1013
                        DynamicForm.handleParentMoved () @ smartgwttest/sc/modules/ISC_Forms.js:281:514
                        Canvas._fireParentMoved () @ smartgwttest/sc/modules/ISC_Core.js:2096:410
                        Canvas.handleParentMoved () @ smartgwttest/sc/modules/ISC_Core.js:2096:244
                        Canvas._fireParentMoved () @ smartgwttest/sc/modules/ISC_Core.js:2096:410
                        Canvas._completeMoveBy () @ smartgwttest/sc/modules/ISC_Core.js:2093:353
                        Canvas.moveBy () @ smartgwttest/sc/modules/ISC_Core.js:2093:199
                        Canvas.moveTo () @ smartgwttest/sc/modules/ISC_Core.js:2116:94
                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
                        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
                        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(Thread.java:724)

                    Comment


                      #11
                      Ah, now we see the issue, in IE11 - we're looking at it now.

                      Comment


                        #12
                        Ok, this IE-only bug is fixed for builds of 4.1 dated February 13 and later - for the future, please be sure to test issues in another browser and let us know which exhibit the issue.

                        Comment


                          #13
                          Not sure why, but didn't get email notification about #12.

                          Testing results with IE 11 and SNAPSHOT_v9.1d_2014-02-17/PowerEdition Deployment (built 2014-02-17)

                          The original bug has been fixed - thank you, but noticed a few other problems.

                          1) calendar.showNewEventDialog(newEvent); shows the dialog on the the top (==0 ), not at the position mouse was clicked

                          2) getDateFromPoint return invalid time (a few hours difference)
                          2a) calendar.getDateFromPoint()
                          2b) calendar.getDateFromPoint(calendar.getWeekView().getOffsetX(), calendar.getWeekView().getOffsetY())

                          3) There are two boxes on the grid (calendar.setEventOverlapPercent(80)) used to I was able to click any of them, and the clicked was selected and also fully visible. But nothing happens now, can't swap them visually (z-order). Was there any change here?


                          Thank you.
                          Last edited by miskolczi.peter; 18 Feb 2014, 02:20.

                          Comment


                            #14
                            Do you need anything more for problems described 17th Feb?

                            Comment


                              #15
                              Sorry for the delay, it's being looked into today.

                              Comment

                              Working...
                              X