Announcement

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

    conflick of functions ListGridField.setGroupTitleRenderer and Timeline.setDateHeaderCustomizer in Timeline

    Hello dear developers.
    I have encountered a problem where using the setGroupTitleRenderer and setDateHeaderCustomizer functions in Timeline simultaneously leads to warnings and ignoring the setDateHeaderCustomizer function.

    If I use these functions separately, everything works correctly.

    Here's my code....

    Code:
            ListGridField pageTitleField = new ListGridField("title", "title");
            pageTitleField.setWidth(200);
    
            ListGridField pageGroupField = new ListGridField(GROUP_ID);
            pageGroupField.setHidden(true);
            pageGroupField.setCanGroupBy(true);
            pageGroupField.setGroupTitleRenderer(new GroupTitleRenderer() {
                @Override
                public String getGroupTitle(Object groupValue, GroupNode groupNode, ListGridField field, String fieldName, ListGrid grid) {
                    Record group = projectsTree.find("@id", groupValue);
                    return group.getAttribute("title");
                }
            });
    
            HeaderLevel dayLevel = new HeaderLevel(TimeUnit.DAY);
            dayLevel.setHeaderWidth(50);
            HeaderLevel[] headerLevels = new HeaderLevel[]{
                    new HeaderLevel(TimeUnit.WEEK),
                    dayLevel
            };
            tasksLine = new Timeline();
            tasksLine.setHeight("100%");
            tasksLine.setHeaderLevels(headerLevels);
            tasksLine.setShowComplexFields(true);
            tasksLine.setShowIndicators(true);
            tasksLine.setShowIndicatorsInFront(true);
            tasksLine.setShowQuickEventDialog(false);
            tasksLine.setStartDate(currentDate);
            tasksLine.setCanRemoveEvents(false);
            tasksLine.setShowEventDescriptions(false);
            tasksLine.setCanEditLane(false);
            tasksLine.setLaneEventPadding(2);
            tasksLine.setLaneFields(pageTitleField, pageGroupField);
            tasksLine.setCanGroupLanes(true);
            tasksLine.setLaneGroupByField(GROUP_ID);
            tasksLine.setNameField("title");
            tasksLine.setHideUnusedLanes(false);
            tasksLine.setResolution(headerLevels, TimeUnit.MONTH, 1, null);
            tasksLine.setLanes(tasksLanes);
    
            tasksLine.setDateHeaderCustomizer(new DateHeaderCustomizer() {
                public String getHeaderTitle(Date date, int dayOfWeek, String defaultValue, CalendarView calendarView) {
                    return DateTimeFormat.getFormat("d.M").format(date);
                }
            });
    the following warnings appear

    Code:
    *11:26:22.654:TMR3[E0]:WARN:Log:Uncaught exception escaped: java.lang.AssertionError
    undefined
        at G5_g$(com.bug.TestBug-0.js@8:441)
        at a6d_g$(com.bug.TestBug-0.js@9:1969)
        at new g6d_g$(com.bug.TestBug-0.js@10:2003)
        at V6c_g$(com.bug.TestBug-0.js@10:1835)
        at uFh_g$(com.bug.TestBug-0.js@20:131286)
        at qvg_g$(com.bug.TestBug-0.js@10:95096)
        at Oc_g$(com.bug.TestBug-0.js@10:6188)
        at bh_g$(com.bug.TestBug-0.js@14:7469)
        at <anonymous>(com.bug.TestBug-0.js@30:126780)
        at Eeb_g$(com.bug.TestBug-0.js@28:22498)
        at Heb_g$(com.bug.TestBug-0.js@16:22554)
        at getDateHeaderTitle(com.bug.TestBug-0.js@14:22534)
        at isc_CalendarView_getFieldTitle(http://127.0.0.1:8888/sc/modules/ISC_Calendar.js@507:59)
        at isc_ListGrid_getHeaderButtonTitle(http://127.0.0.1:8888/sc/modules/ISC_Grids.js@200:2795)
        at buttonTitleFunction(http://127.0.0.1:8888/sc/modules/ISC_Grids.js@358:2666)
        at isc_StatefulCanvas_getTitleHTML(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@229:199)
        at isc_c_Class_invokeSuper(http://127.0.0.1:8888/sc/modules/ISC_Core.js@162:298)
        at isc_Button_getTitleHTML(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@168:524)
        at isc_Button_getInnerHTML(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@431:485)
        at isc_Canvas__getInnerHTML(http://127.0.0.1:8888/sc/modules/ISC_Core.js@68:2918)
        at isc_Canvas__insertHTML(http://127.0.0.1:8888/sc/modules/ISC_Core.js@229:2994)
        at isc_Canvas_draw(http://127.0.0.1:8888/sc/modules/ISC_Core.js@220:2940)
        at isc_StatefulCanvas_draw(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@431:195)
        at isc_Layout_layoutChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@264:339)
        at isc_Layout_drawChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@640:248)
        at isc_Canvas_draw(http://127.0.0.1:8888/sc/modules/ISC_Core.js@253:2940)
        at isc_c_Class_invokeSuper(http://127.0.0.1:8888/sc/modules/ISC_Core.js@162:298)
        at isc_Toolbar_draw(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@493:630)
        at isc_c_Class_invokeSuper(http://127.0.0.1:8888/sc/modules/ISC_Core.js@93:298)
        at isc_c_Class_Super(http://127.0.0.1:8888/sc/modules/ISC_Core.js@170:290)
        at draw(http://127.0.0.1:8888/sc/modules/ISC_Grids.js@6:2727)
        at isc_Layout_layoutChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@264:339)
        at isc_Layout_drawChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@640:248)
        at isc_Canvas_draw(http://127.0.0.1:8888/sc/modules/ISC_Core.js@253:2940)
        at isc_ListGrid__updateFieldWidths(http://127.0.0.1:8888/sc/modules/ISC_Grids.js@183:1357)
        at isc_ListGrid_layoutChildren(http://127.0.0.1:8888/sc/modules/ISC_Grids.js@66:1327)
        at isc_Layout_drawChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@640:248)
        at isc_Canvas_draw(http://127.0.0.1:8888/sc/modules/ISC_Core.js@253:2940)
        at isc_c_Class_invokeSuper(http://127.0.0.1:8888/sc/modules/ISC_Core.js@162:298)
        at isc_ListGrid_draw(http://127.0.0.1:8888/sc/modules/ISC_Grids.js@621:1412)
        at isc_c_Class_invokeSuper(http://127.0.0.1:8888/sc/modules/ISC_Core.js@93:298)
        at isc_c_Class_Super(http://127.0.0.1:8888/sc/modules/ISC_Core.js@170:290)
        at isc_CalendarView_draw(http://127.0.0.1:8888/sc/modules/ISC_Calendar.js@372:224)
        at isc_c_Class_invokeSuper(http://127.0.0.1:8888/sc/modules/ISC_Core.js@162:298)
        at isc_TimelineView_draw(http://127.0.0.1:8888/sc/modules/ISC_Calendar.js@72:397)
        at isc_Layout_layoutChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@264:339)
        at isc_Layout_drawChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@640:248)
        at isc_Canvas_draw(http://127.0.0.1:8888/sc/modules/ISC_Core.js@253:2940)
        at isc_Layout_layoutChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@205:337)
        at isc_Layout_drawChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@640:248)
        at isc_Canvas_draw(http://127.0.0.1:8888/sc/modules/ISC_Core.js@253:2940)
        at isc_Canvas_drawChildren(http://127.0.0.1:8888/sc/modules/ISC_Core.js@241:2986)
        at isc_Canvas_draw(http://127.0.0.1:8888/sc/modules/ISC_Core.js@253:2940)
        at isc_c_Class_invokeSuper(http://127.0.0.1:8888/sc/modules/ISC_Core.js@162:298)
        at isc_Calendar_draw(http://127.0.0.1:8888/sc/modules/ISC_Calendar.js@250:564)
        at isc_Layout_layoutChildren(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@264:339)
        at isc_Layout_reflowNow(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@568:371)
        at isc_c_Layout_clearReflowQueue(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@447:232)
        at anonymous(http://127.0.0.1:8888/sc/modules/ISC_Foundation.js@82:232)
        at isc_c_EventHandler_runTeas(http://127.0.0.1:8888/sc/modules/ISC_Core.js@106:2501)
        at isc_c_EventHandler__clearThread(http://127.0.0.1:8888/sc/modules/ISC_Core.js@136:2498)
        at isc_c_Timer__fireTimeout(http://127.0.0.1:8888/sc/modules/ISC_Core.js@210:2073)
    Is this a Timeline component error? Or did I do something wrong?

    PS.
    My SmartGWT version is SNAPSHOT_v12.1d_2019-12-11
    Last edited by Hirn; 24th Mar 2020, 02:34.

    #2
    There's an order-of-operations issue here, which we're looking into.

    In the meantime, you can work around it - remove your call to tasksLine.setLaneGroupByField(GROUP_ID) and, instead, *wait until the timeline has been drawn* and then call tasksLine.groupLanesBy(GROUP_ID).

    Comment

    Working...
    X