Announcement

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

    Timeline on Portlet crashes when user maximizes the Portlet

    we have a Timeline that is placed on a Portlet in our application and we recently upgraded to smartgwt version 13.0p-20230509
    after the upgrade, the Timeline crashes when the user maximizes the Portlet
    please let us know how we could overcome this issue
    thanks in advance

    Click image for larger version

Name:	2023-09-27 13_29_08-Clipboard2.png
Views:	131
Size:	17.3 KB
ID:	271011

    Code:
    // demo shows date September 22nd 2023
    
    Date periodStart = createDate(2023, 9, 22, 0, 0, 0);
    
    Date periodEnd = createDate(2023, 9, 22, 23, 59, 59);
    
    
    
    @Override
    
    public void onModuleLoad() {
    
    PortalLayout portalLayout = new PortalLayout(1);
    
    portalLayout.setWidth100();
    
    portalLayout.setHeight100();
    
    
    
    Portlet portlet = new Portlet();
    
    portlet.setTitle("Demo");
    
    portlet.addItem(createTimeline(periodStart, periodEnd));
    
    
    
    portalLayout.addPortlet(portlet);
    
    portalLayout.draw();
    
    }
    
    
    
    private static Timeline createTimeline(Date startDate, Date endDate) {
    
    Timeline timeline = new Timeline();
    
    timeline.setLaneFields(new ListGridField("title", "Demo lanes", 200));
    
    timeline.setStartDate(startDate);
    
    timeline.setEndDate(endDate);
    
    
    
    timeline.setShowDateCustomizer(new ShowDateCustomizer() {
    
    
    
    @Override
    
    public boolean shouldShowDate(Date date, CalendarView calendarView) {
    
    return date.equals(startDate) || date.equals(endDate) || (date.after(startDate) && date.before(endDate));
    
    }
    
    });
    
    timeline.setResolution(new HeaderLevel[] { new HeaderLevel(TimeUnit.MINUTE) }, TimeUnit.MINUTE, 24 * 60, 60);
    
    
    
    return timeline;
    
    }
    
    
    
    static Date createDate(int year, int month, int day, int hour, int minute, int second) {
    
    return new Date(year - 1900, month - 1, day, hour, minute, second);
    
    }

    The following error occurs:


    Uncaught TypeError: Cannot set properties of null (setting 'endLeftOffset') at _3.isc_TimelineView_buildSnapGapList [as buildSnapGapList] (ISC_Calendar.js:411:27) at _3.isc_TimelineView__rebuildFields [as $1731] (ISC_Calendar.js:412:349) at _3.isc_TimelineView__rebuild [as $152e] (ISC_Calendar.js:412:768) at _3.isc_TimelineView_setTimelineRange [as setTimelineRange] (ISC_Calendar.js:424:256) at _3.isc_TimelineView_setChosenDate [as setChosenDate] (ISC_Calendar.js:355:83) at _3.isc_Calendar_setChosenDate [as setChosenDate] (ISC_Calendar.js:616:399) at _3.isc_Calendar_draw [as draw] (ISC_Calendar.js:625:41) at _3.isc_Layout_layoutChildren [as layoutChildren] (ISC_Foundation.js:344:264) at _3.isc_Layout_drawChildren [as drawChildren] (ISC_Foundation.js:254:653) at _3.isc_Canvas_draw [as draw] (ISC_Core.js:3183:253) at _3.isc_Layout_layoutChildren [as layoutChildren] (ISC_Foundation.js:336:139) at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js:292:162) at _3.isc_Window_layoutChildren [as layoutChildren] (ISC_Containers.js:131:6) at _3.isc_Layout_drawChildren [as drawChildren] (ISC_Foundation.js:254:653) at _3.isc_Canvas_draw [as draw] (ISC_Core.js:3183:253) at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js:292:162) at _3.isc_Window_draw [as draw] (ISC_Containers.js:71:820) at _3.isc_Portlet__createPlaceholder [as $123b] (ISC_Containers.js:192:148) at _3.isc_Portlet_maximize [as maximize] (ISC_Containers.js:193:136) at _3.click (ISC_Containers.js:56:321) at _3.isc_StatefulCanvas_handleActivate [as handleActivate] (ISC_Foundation.js:219:108) at _3.isc_StatefulCanvas_handleClick [as handleClick] (ISC_Foundation.js:220:13) at _3.isc_c_EventHandler_bubbleEvent [as bubbleEvent] (ISC_Core.js:2515:89) at _3.isc_c_EventHandler_handleClick [as handleClick] (ISC_Core.js:2323:50) at _3.isc_c_EventHandler__handleMouseUp [as $k5] (ISC_Core.js:2305:11) at _3.isc_c_EventHandler_handleMouseUp [as handleMouseUp] (ISC_Core.js:2296:57) at _3.isc_c_EventHandler_dispatch [as dispatch] (ISC_Core.js:2614:122) at HTMLDocument.eval (eval at isc__makeFunction (ISC_Core.js:69:1135), <anonymous>:3:123)

    #2
    We aren't seeing any problems in this area testing just now. However, there were fixes to Portlet maximization over the summer, and your build is from May.

    Please retest with the latest build from smartclient.com/builds.

    Comment


      #3
      Thanks. We have retested this with the build of October 1st. The error is indeed gone, but what currently happens is still unexpected: when the portlet is maximized, the timelines' start and end dates are shifted.
      Given the example in my first post:

      Before maximizing getStartDate() returns 22-09-2023 00:00:00 and getEndDate() returns 22-09-2023 23:59:59
      After maximizing getStartDate() returns 22-09-2023 12:00:00 and getEndDate() returns 23-09-2023 11:59:59

      Please notice that the end date now falls in the next day (but is not shown because of the ShowDateCustomizer)

      Not sure if this is useful information regarding the issue: After restoring the window the timeline period is not restored.


      Click image for larger version

Name:	2023-10-02 11_51_23-Clipboard.png
Views:	93
Size:	12.8 KB
ID:	271066

      Comment


        #4
        We'll take another look with this context and update here when we have more information.

        Please confirm your OS and browser, and your browser timezone (we suspect UTC+3 with current DST).

        Comment


          #5
          Thanks for your quick reply.
          We have tested and reproduced this issue on the following:

          OS: Windows 11 Pro (with latest updates)
          Browsers:
          - Chrome 117.0.5938.92
          - Firefox 117.0.1

          Our browser timezone is UTC+2 (with current DST indeed)

          Comment


            #6
            Ok, we see the issue - internal logic was converting your startDate from a Datetime to a LogicalDate, which always start at 12:00, when re-drawing.

            We've made a change to address it and you can try it out in tomorrow's builds, dated October 3 or later.

            Comment


              #7
              Thanks a lot, we have tested the nightly build of October 3rd and this issue is solved now

              Comment

              Working...
              X