Revision history [back]

click to hide/show revision 1
initial version

asked 2021-03-05 22:08:55 +0800

BenBrandNLD gravatar image BenBrandNLD

aux header dropped, column disappears

I am creating a grid of monthly dates for planning purposes. I build this dynamically based on the current month and allow the user to jump up/down a month. There are three header rows, the top spanning the week and then 2 aux header rows spanning 1 column showing the month day and day of the week. Towards the end of the month, a column is "dropped" from view, although it is built and added to the parent like all the others. This is random towards the end of the month, I cannot find any reason why it would be that specific column, more so because it comes and goes and is a different column each time. This seems to be a BUG. I am using the latest release in Maven and Chrome that is up to date/patched. Edge gives the same results.

ZUL:

<?xml version="1.0" encoding="UTF-8"?>

<zk xmlns="www.zkoss.org/2005/zul"> <window id="mainWindow" width="100%" height="100%" apply="brand.test.TestPlannerM"> <borderlayout> <north id="planFrame" size="85%"> <tabbox id="mainTabBox" hflex="1"> <tabs id="scheduleTabs"> <tab id="monthTab" label="Month"/> </tabs> <tabpanels> <tabpanel id="monthTabPanel" style="overflow: auto"/> </tabpanels> </tabbox> </north> <south id="statusFrame" size="15%">

<button id="backUpButton" width="100px" label="Back Up"/> <button id="forwardButton" width="100px" label="Forward"/> <label value="Plan type"/> <combobox id="planType"> <comboitem label="Type 1"/> <comboitem label="Type 2"/> <comboitem label="Type 3"/> <comboitem label="Type 4"/> </combobox>

                Working on
                <label id="mapStatusLabel"/>
                , current view date:
                <label id="currentViewLabel"/>
                , week:
                <label id="currentWLabel"/>
                , month
                <label id="currentMLabel"/>
                , quarter
                <label id="currentQLabel"/>
                , year
                <label id="currentYLabel"/>
            </div>
        </south>
    </borderlayout>
</window>

</zk>

Java:

// package brand.test; //

import brand.xrdbwrapper.XRGetWrapper; import java.time.DayOfWeek; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoField; import static java.time.temporal.ChronoUnit.DAYS; import java.time.temporal.IsoFields; import java.util.ArrayList; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventQueue; import org.zkoss.zk.ui.util.Composer; import org.zkoss.zk.ui.util.GenericForwardComposer; import org.zkoss.zul.Auxhead; import org.zkoss.zul.Auxheader; import org.zkoss.zul.Button; import org.zkoss.zul.Column; import org.zkoss.zul.Columns; import org.zkoss.zul.Grid; import org.zkoss.zul.Label; import org.zkoss.zul.North; import org.zkoss.zul.South; import org.zkoss.zul.Tab; import org.zkoss.zul.Tabbox; import org.zkoss.zul.Tabpanel; import org.zkoss.zul.Tabpanels; import org.zkoss.zul.Tabs; import org.zkoss.zul.Vlayout; import org.zkoss.zul.Window; import org.zkoss.zul.theme.Themes;

/**


  • @author Ben Brand */ public class TestPlannerM extends GenericForwardComposer implements Composer {

    Window mainWindow; // North planFrame; South statusFrame; North roleFrame; South capacityFrame; // Tabbox mainTabBox; Tabs scheduleTabs; Tab monthTab; Tabpanels scheduleTabPanels; Tabpanel monthTabPanel; Label mapStatusLabel; Label currentViewLabel; Label currentWLabel; Label currentMLabel; Label currentQLabel; Label currentYLabel; // Button backUpButton; Button fowardButton; // private DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd//MMMM/yy (ww) (q)"); private DateTimeFormatter ldtf = DateTimeFormatter.ofPattern("dd/MM/yy"); // private Integer currentPlanView = 0; // which planview are we using, if zero then all managed entities // String auxStyle = "font-size:8px;text-align:left;padding:0px 0px"; // private EventQueue eq; // XRGetWrapper xrg = new XRGetWrapper(); // // vLayout to stack the grids Vlayout weekGroup = new Vlayout(); Vlayout monthGroup = new Vlayout(); Vlayout quarterGroup = new Vlayout(); // // set dates to now, and then to the start of the periods // also, update the status bar to reflect these dates LocalDateTime viewDate = LocalDateTime.now(); // controles what date we are current viewing // // week Grid wGrid = new Grid(); LocalDateTime currentWeekView = LocalDateTime.now(); // // month Grid mGrid = new Grid(); int currentMonthInView = 0; LocalDateTime currentMonthView = LocalDateTime.now(); // controles what date we are current viewing // // quarter Grid qGrid = new Grid(); int currentQuarterInView = 0; LocalDateTime currentQuarterView = LocalDateTime.now(); // controles what date we are current viewing // Grid wCapGrid = new Grid(); Grid mCapGrid = new Grid(); Grid qCapGrid = new Grid(); // ArrayList buckets = new ArrayList(); // the capacity buckets

    @Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); Themes.setTheme(Executions.getCurrent(), "sapphire"); // mainWindow.setVisible(true); mainWindow.setTitle("TEST");

    mainTabBox.setVisible(true);
    mapStatusLabel.setValue("TEST SPRINT 03");
    //
    currentViewLabel.setValue(dtf.format(viewDate));
    //
    monthGroup.setHeight("max");
    monthTabPanel.appendChild(monthGroup);
    //
    // build three basic grids, week, month, quarter;
    // each has a capacity gris for the 4 (?) capacity
    // buckets
    //
    // *** MONTH
    mGrid.setId("mGrid");
    mGrid.setHeight("350px");
    mGrid.setHflex("1");
    mGrid.setParent(monthTabPanel);
    //
    mCapGrid.setId("mCapGrid");
    mCapGrid.setHflex("1");
    mCapGrid.setVflex("1");
    mGrid.setParent(monthTabPanel);
    //
    ArrayList monthList = buildMonthGrid(viewDate);
    currentMLabel.setValue(ldtf.format((LocalDateTime) monthList.get(0)));
    //
    //
    // capacity buckets, hard coded at the moment
    buckets.add(new String[]{"", "opportunity", "30", "60", "90"});
    buckets.add(new String[]{"", "soft booked", "30", "60", "90"});
    buckets.add(new String[]{"", "booked", "30", "60", "90"});
    buckets.add(new String[]{"", "assigned", "30", "60", "90"});
    

    }

    public void onClick$backUpButton(Event event) { int currentTab = mainTabBox.getSelectedIndex(); switch (currentTab) { case 0: { // month LocalDateTime t = currentMonthView.minusMonths(1); viewDate = t; ArrayList monthList = buildMonthGrid(viewDate); break; } case 1: { // quarter LocalDateTime t = currentQuarterView.minusMonths(3); viewDate = t; break; } case 2: { // week LocalDateTime t = currentWeekView.minusDays(7); viewDate = t; break; } default: break; } }

    public void onClick$forwardButton(Event event) { int currentTab = mainTabBox.getSelectedIndex(); switch (currentTab) { case 0: { // month LocalDateTime t = currentMonthView.plusMonths(1); viewDate = t; ArrayList monthList = buildMonthGrid(viewDate); break; } case 1: { // quarter LocalDateTime t = currentQuarterView.plusMonths(3); viewDate = t; break; } case 2: { // week LocalDateTime t = currentWeekView.plusDays(7); viewDate = t; break; } default: break; } }

    private ArrayList buildMonthGrid(LocalDateTime viewMonth) { // // month: capacity per day // header 1 - week spans with week numbers // header 2 - day // header 3 - date (dd) //

    //
    // the dates of the columns are kept in this list
    ArrayList columnDates = new ArrayList();
    //
    // formatters
    DateTimeFormatter f1 = DateTimeFormatter.ofPattern("dd"); // header 2
    DateTimeFormatter f2 = DateTimeFormatter.ofPattern("E"); // header 3
    //
    // clear the grid
    mGrid.getChildren().clear();
    mCapGrid.getChildren().clear();
    //
    // setup some dates: the start of the month, end of the month and
    // .. the first day of the week that the month starts, used for looping
    int thisMonth = viewMonth.getMonthValue();
    LocalDateTime monthStarts = viewMonth.with(ChronoField.DAY_OF_MONTH, 1);
    LocalDateTime viewStarts = monthStarts.with(ChronoField.DAY_OF_WEEK, 1);
    LocalDateTime checkDate = monthStarts.plusMonths(1);
    LocalDateTime monthEnds = checkDate.minusDays(1);
    LocalDateTime viewEnds = monthEnds.with(ChronoField.DAY_OF_WEEK, 7);
    long daysInView = DAYS.between(viewStarts, monthEnds);
    //
    // days in the month, used to build the columns
    
    //
    // first 2 columns, 1 hidden, the other the start date of the month in the grid
    // build header 1: week numbers
    Auxhead auxHead1 = new Auxhead();
    auxHead1.setHflex("1");
    Auxheader ah11 = new Auxheader();
    ah11.setColspan(2); // also needs to span the hidden column so span = 2
    ah11.setLabel("Month planning for " + dtf.format(monthStarts));
    ah11.setStyle(auxStyle);
    ah11.setParent(auxHead1);
    //
    // now run through the weeks
    LocalDateTime loopDate = viewStarts;
    DateTimeFormatter mdtf = DateTimeFormatter.ofPattern("MMMM yy/ww");
    //
    weeknumbers:
    while (!loopDate.isAfter(viewEnds)) {
        int weekNumber = loopDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR);
        Auxheader ahWeek = new Auxheader();
        ahWeek.setColspan(7);
        ahWeek.setLabel(mdtf.format(loopDate));
        ahWeek.setStyle(auxStyle + ";text-align:center");
        ahWeek.setParent(auxHead1);
        // next week, see if we have dropped off the month
        checkDate = loopDate.plusDays(7);
        loopDate = checkDate;
    }
    //
    // headers 2 & 3; both are days
    
    Auxhead auxHead2 = new Auxhead();
    auxHead2.setHflex("1");
    Auxhead auxHead3 = new Auxhead();
    auxHead3.setHflex("1");
    //
    // first two columns
    Auxheader ah21 = new Auxheader();
    ah21.setColspan(2);
    ah21.setLabel("");
    ah21.setParent(auxHead2);
    //
    Auxheader ah31 = new Auxheader();
    ah31.setColspan(2);
    ah31.setLabel("Role");
    ah31.setStyle(auxStyle);
    ah31.setParent(auxHead3);
    //
    // loop through the days of the month
    loopDate = viewStarts;
    int m = 0;
    dayloop1:
    while (!loopDate.isAfter(viewEnds)) {
        columnDates.add(loopDate); // save to be used later
        ++m;
        Auxheader ahDay1 = new Auxheader();
        Auxheader ahDay2 = new Auxheader();
        ahDay1.setLabel(f2.format(loopDate));
        ahDay2.setLabel(f1.format(loopDate));
        ahDay1.setColspan(1);
        ahDay2.setColspan(1);
        System.out.println("**** " + m + ":=" + ahDay1.getLabel() + "|" + ahDay2.getLabel());
        if (loopDate.getDayOfWeek() == DayOfWeek.SATURDAY
                || loopDate.getDayOfWeek() == DayOfWeek.SUNDAY) {
            ahDay1.setStyle(auxStyle + ";background:gray;color:white");
            ahDay2.setStyle(auxStyle + ";background:gray;color:white");
        } else if (loopDate.getMonthValue() != thisMonth) {
            ahDay1.setStyle(auxStyle + ";color:lightgray");
            ahDay2.setStyle(auxStyle + ";color:lightgray");
        } else {
            ahDay1.setStyle(auxStyle);
            ahDay2.setStyle(auxStyle);
        }
        ahDay1.setParent(auxHead2);
        // ahDay2.setParent(auxHead3);
        checkDate = loopDate.plusDays(1);
        loopDate = checkDate;
    }
    //
    // done, add headers to the grid
    auxHead1.setParent(mGrid);
    auxHead2.setParent(mGrid);
    auxHead3.setParent(mGrid);
    //
    Auxhead auxHeadc = new Auxhead();
    Auxheader ahc = new Auxheader();
    ahc.setColspan(2);
    ahc.setLabel("Capacity Bucket");
    ahc.setStyle(auxStyle);
    ahc.setParent(auxHeadc);
    auxHeadc.setParent(mCapGrid);
    //
    // build columns (= ID of role (hidden), role description, days of week)
    Columns roleCols = new Columns();
    roleCols.setSizable(true);
    roleCols.setParent(mGrid);
    //
    Columns capCols = new Columns();
    capCols.setSizable(true);
    capCols.setParent(mCapGrid);
    //
    // hidden id column
    Column idrColumn = new Column();
    idrColumn.setWidth("5%");
    idrColumn.setVisible(false);
    mGrid.getColumns().appendChild(idrColumn);
    //
    Column idcColumn = new Column();
    idcColumn.setWidth("5%");
    idcColumn.setVisible(false);
    mCapGrid.getColumns().appendChild(idcColumn);
    //
    // id descriptor column
    Column roleColumn = new Column();
    roleColumn.setWidth("20%");
    mGrid.getColumns().appendChild(roleColumn);
    //
    Column capColumn = new Column();
    capColumn.setWidth("20%");
    mCapGrid.getColumns().appendChild(capColumn);
    //
    // build columns and labels
    for (int i = 1; i < daysInView; ++i) {
        Column dcr = new Column();
        mGrid.getColumns().appendChild(dcr);
        //
        Column dcc = new Column();
        mCapGrid.getColumns().appendChild(dcc);
    }
    //
    // build the tab panel
    monthGroup.getChildren().clear();
    monthGroup.appendChild(mGrid);
    monthGroup.appendChild(mCapGrid);
    monthTabPanel.getChildren().clear();
    monthTabPanel.appendChild(monthGroup);
    //
    // force that everything is rendered
    monthTabPanel.invalidate();
    //
    // bookmark where we are
    currentWLabel.setValue(ldtf.format(monthStarts));
    currentMonthView = monthStarts;
    //
    return columnDates;
    

    } }

aux header dropped, column disappears

I am creating a grid of monthly dates for planning purposes. purposes.

I build this dynamically based on the current month and allow the user to jump up/down a month. There are three header rows, the top spanning the week (7 columns) and then 2 aux header auxheader rows each spanning 1 column showing the month date and day and day of the week. of the week.

Towards the end of the month, a column is "dropped" from view, although it is built and added to the parent like all the others. This is random towards the end of the month, I cannot find any reason why it would be that specific column, more so because it comes and goes and is a different column each time. time.

This seems to be a BUG. I am using the latest release in Maven and Chrome that is up to date/patched. Edge gives the same results.

ZUL:

<?xml version="1.0" encoding="UTF-8"?>

<zk xmlns="www.zkoss.org/2005/zul"> <window id="mainWindow" width="100%" height="100%" apply="brand.test.TestPlannerM"> <borderlayout> <north id="planFrame" size="85%"> <tabbox id="mainTabBox" hflex="1"> <tabs id="scheduleTabs"> <tab id="monthTab" label="Month"/> </tabs> <tabpanels> <tabpanel id="monthTabPanel" style="overflow: auto"/> </tabpanels> </tabbox> </north> <south id="statusFrame" size="15%">

<button id="backUpButton" width="100px" label="Back Up"/> <button id="forwardButton" width="100px" label="Forward"/> <label value="Plan type"/> <combobox id="planType"> <comboitem label="Type 1"/> <comboitem label="Type 2"/> <comboitem label="Type 3"/> <comboitem label="Type 4"/> </combobox>

                Working on
                <label id="mapStatusLabel"/>
                , current view date:
                <label id="currentViewLabel"/>
                , week:
                <label id="currentWLabel"/>
                , month
                <label id="currentMLabel"/>
                , quarter
                <label id="currentQLabel"/>
                , year
                <label id="currentYLabel"/>
            </div>
        </south>
    </borderlayout>
</window>

</zk>

Java:

// package brand.test; //

import brand.xrdbwrapper.XRGetWrapper; import java.time.DayOfWeek; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoField; import static java.time.temporal.ChronoUnit.DAYS; import java.time.temporal.IsoFields; import java.util.ArrayList; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventQueue; import org.zkoss.zk.ui.util.Composer; import org.zkoss.zk.ui.util.GenericForwardComposer; import org.zkoss.zul.Auxhead; import org.zkoss.zul.Auxheader; import org.zkoss.zul.Button; import org.zkoss.zul.Column; import org.zkoss.zul.Columns; import org.zkoss.zul.Grid; import org.zkoss.zul.Label; import org.zkoss.zul.North; import org.zkoss.zul.South; import org.zkoss.zul.Tab; import org.zkoss.zul.Tabbox; import org.zkoss.zul.Tabpanel; import org.zkoss.zul.Tabpanels; import org.zkoss.zul.Tabs; import org.zkoss.zul.Vlayout; import org.zkoss.zul.Window; import org.zkoss.zul.theme.Themes;

/**


  • @author Ben Brand */ public class TestPlannerM extends GenericForwardComposer implements Composer {

    Window mainWindow; // North planFrame; South statusFrame; North roleFrame; South capacityFrame; // Tabbox mainTabBox; Tabs scheduleTabs; Tab monthTab; Tabpanels scheduleTabPanels; Tabpanel monthTabPanel; Label mapStatusLabel; Label currentViewLabel; Label currentWLabel; Label currentMLabel; Label currentQLabel; Label currentYLabel; // Button backUpButton; Button fowardButton; // private DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd//MMMM/yy (ww) (q)"); private DateTimeFormatter ldtf = DateTimeFormatter.ofPattern("dd/MM/yy"); // private Integer currentPlanView = 0; // which planview are we using, if zero then all managed entities // String auxStyle = "font-size:8px;text-align:left;padding:0px 0px"; // private EventQueue eq; // XRGetWrapper xrg = new XRGetWrapper(); // // vLayout to stack the grids Vlayout weekGroup = new Vlayout(); Vlayout monthGroup = new Vlayout(); Vlayout quarterGroup = new Vlayout(); // // set dates to now, and then to the start of the periods // also, update the status bar to reflect these dates LocalDateTime viewDate = LocalDateTime.now(); // controles what date we are current viewing // // week Grid wGrid = new Grid(); LocalDateTime currentWeekView = LocalDateTime.now(); // // month Grid mGrid = new Grid(); int currentMonthInView = 0; LocalDateTime currentMonthView = LocalDateTime.now(); // controles what date we are current viewing // // quarter Grid qGrid = new Grid(); int currentQuarterInView = 0; LocalDateTime currentQuarterView = LocalDateTime.now(); // controles what date we are current viewing // Grid wCapGrid = new Grid(); Grid mCapGrid = new Grid(); Grid qCapGrid = new Grid(); // ArrayList buckets = new ArrayList(); // the capacity buckets

    @Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); Themes.setTheme(Executions.getCurrent(), "sapphire"); // mainWindow.setVisible(true); mainWindow.setTitle("TEST");

    mainTabBox.setVisible(true);
    mapStatusLabel.setValue("TEST SPRINT 03");
    //
    currentViewLabel.setValue(dtf.format(viewDate));
    //
    monthGroup.setHeight("max");
    monthTabPanel.appendChild(monthGroup);
    //
    // build three basic grids, week, month, quarter;
    // each has a capacity gris for the 4 (?) capacity
    // buckets
    //
    // *** MONTH
    mGrid.setId("mGrid");
    mGrid.setHeight("350px");
    mGrid.setHflex("1");
    mGrid.setParent(monthTabPanel);
    //
    mCapGrid.setId("mCapGrid");
    mCapGrid.setHflex("1");
    mCapGrid.setVflex("1");
    mGrid.setParent(monthTabPanel);
    //
    ArrayList monthList = buildMonthGrid(viewDate);
    currentMLabel.setValue(ldtf.format((LocalDateTime) monthList.get(0)));
    //
    //
    // capacity buckets, hard coded at the moment
    buckets.add(new String[]{"", "opportunity", "30", "60", "90"});
    buckets.add(new String[]{"", "soft booked", "30", "60", "90"});
    buckets.add(new String[]{"", "booked", "30", "60", "90"});
    buckets.add(new String[]{"", "assigned", "30", "60", "90"});
    

    }

    public void onClick$backUpButton(Event event) { int currentTab = mainTabBox.getSelectedIndex(); switch (currentTab) { case 0: { // month LocalDateTime t = currentMonthView.minusMonths(1); viewDate = t; ArrayList monthList = buildMonthGrid(viewDate); break; } case 1: { // quarter LocalDateTime t = currentQuarterView.minusMonths(3); viewDate = t; break; } case 2: { // week LocalDateTime t = currentWeekView.minusDays(7); viewDate = t; break; } default: break; } }

    public void onClick$forwardButton(Event event) { int currentTab = mainTabBox.getSelectedIndex(); switch (currentTab) { case 0: { // month LocalDateTime t = currentMonthView.plusMonths(1); viewDate = t; ArrayList monthList = buildMonthGrid(viewDate); break; } case 1: { // quarter LocalDateTime t = currentQuarterView.plusMonths(3); viewDate = t; break; } case 2: { // week LocalDateTime t = currentWeekView.plusDays(7); viewDate = t; break; } default: break; } }

    private ArrayList buildMonthGrid(LocalDateTime viewMonth) { // // month: capacity per day // header 1 - week spans with week numbers // header 2 - day // header 3 - date (dd) //

    //
    // the dates of the UPDATE 

    I did another test and added the columns/auxheaders not via a programmatic loop but hardcoded the whole thing into the zul and the java. The SAME columns are kept in this list ArrayList columnDates = new ArrayList(); // // formatters DateTimeFormatter f1 = DateTimeFormatter.ofPattern("dd"); // header 2 DateTimeFormatter f2 = DateTimeFormatter.ofPattern("E"); // header 3 // // clear the grid mGrid.getChildren().clear(); mCapGrid.getChildren().clear(); // // setup some dates: the start of the month, end of dropped out of the headers. Wtf, the SAME ones!! It is not random because as you move up/down in the month and // .. the first day of the week that the month starts, used for looping int thisMonth = viewMonth.getMonthValue(); LocalDateTime monthStarts = viewMonth.with(ChronoField.DAY_OF_MONTH, 1); LocalDateTime viewStarts = monthStarts.with(ChronoField.DAY_OF_WEEK, 1); LocalDateTime checkDate = monthStarts.plusMonths(1); LocalDateTime monthEnds = checkDate.minusDays(1); LocalDateTime viewEnds = monthEnds.with(ChronoField.DAY_OF_WEEK, 7); long daysInView = DAYS.between(viewStarts, monthEnds); // // days in the month, used to build the columns // // first 2 columns, 1 hidden, the other the start date of the month in the grid // build header 1: week numbers Auxhead auxHead1 = new Auxhead(); auxHead1.setHflex("1"); Auxheader ah11 = new Auxheader(); ah11.setColspan(2); // also needs to span the hidden column the same columns are dropped in both use-cases.

    Somewhere the auxheaders list gets corrupted and just ignores a column. The column (kind of) exits when you add a row, so span = 2 ah11.setLabel("Month planning for " + dtf.format(monthStarts)); ah11.setStyle(auxStyle); ah11.setParent(auxHead1); // // now run through the weeks LocalDateTime loopDate = viewStarts; DateTimeFormatter mdtf = DateTimeFormatter.ofPattern("MMMM yy/ww"); // weeknumbers: while (!loopDate.isAfter(viewEnds)) { int weekNumber = loopDate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR); Auxheader ahWeek = new Auxheader(); ahWeek.setColspan(7); ahWeek.setLabel(mdtf.format(loopDate)); ahWeek.setStyle(auxStyle + ";text-align:center"); ahWeek.setParent(auxHead1); // next week, see if we have dropped off the month checkDate = loopDate.plusDays(7); loopDate = checkDate; } // // headers 2 & 3; both are days Auxhead auxHead2 = new Auxhead(); auxHead2.setHflex("1"); Auxhead auxHead3 = new Auxhead(); auxHead3.setHflex("1"); // // first two columns Auxheader ah21 = new Auxheader(); ah21.setColspan(2); ah21.setLabel(""); ah21.setParent(auxHead2); // Auxheader ah31 = new Auxheader(); ah31.setColspan(2); ah31.setLabel("Role"); ah31.setStyle(auxStyle); ah31.setParent(auxHead3); // // loop through the days of the month loopDate = viewStarts; int m = 0; dayloop1: while (!loopDate.isAfter(viewEnds)) { columnDates.add(loopDate); // save to be used later ++m; Auxheader ahDay1 = new Auxheader(); Auxheader ahDay2 = new Auxheader(); ahDay1.setLabel(f2.format(loopDate)); ahDay2.setLabel(f1.format(loopDate)); ahDay1.setColspan(1); ahDay2.setColspan(1); System.out.println("**** " + m + ":=" + ahDay1.getLabel() + "|" + ahDay2.getLabel()); if (loopDate.getDayOfWeek() == DayOfWeek.SATURDAY || loopDate.getDayOfWeek() == DayOfWeek.SUNDAY) { ahDay1.setStyle(auxStyle + ";background:gray;color:white"); ahDay2.setStyle(auxStyle + ";background:gray;color:white"); } else if (loopDate.getMonthValue() != thisMonth) { ahDay1.setStyle(auxStyle + ";color:lightgray"); ahDay2.setStyle(auxStyle + ";color:lightgray"); } else { ahDay1.setStyle(auxStyle); ahDay2.setStyle(auxStyle); } ahDay1.setParent(auxHead2); // ahDay2.setParent(auxHead3); checkDate = loopDate.plusDays(1); loopDate = checkDate; } // // done, add headers to the grid auxHead1.setParent(mGrid); auxHead2.setParent(mGrid); auxHead3.setParent(mGrid); // Auxhead auxHeadc = new Auxhead(); Auxheader ahc = new Auxheader(); ahc.setColspan(2); ahc.setLabel("Capacity Bucket"); ahc.setStyle(auxStyle); ahc.setParent(auxHeadc); auxHeadc.setParent(mCapGrid); // // build columns (= ID of role (hidden), role description, days of week) Columns roleCols = new Columns(); roleCols.setSizable(true); roleCols.setParent(mGrid); // Columns capCols = new Columns(); capCols.setSizable(true); capCols.setParent(mCapGrid); // // hidden id column Column idrColumn = new Column(); idrColumn.setWidth("5%"); idrColumn.setVisible(false); mGrid.getColumns().appendChild(idrColumn); // Column idcColumn = new Column(); idcColumn.setWidth("5%"); idcColumn.setVisible(false); mCapGrid.getColumns().appendChild(idcColumn); // // id descriptor column Column roleColumn = new Column(); roleColumn.setWidth("20%"); mGrid.getColumns().appendChild(roleColumn); // Column capColumn = new Column(); capColumn.setWidth("20%"); mCapGrid.getColumns().appendChild(capColumn); // // build columns and labels for (int i = 1; i < daysInView; ++i) { Column dcr = new Column(); mGrid.getColumns().appendChild(dcr); // Column dcc = new Column(); mCapGrid.getColumns().appendChild(dcc); } // // build the tab panel monthGroup.getChildren().clear(); monthGroup.appendChild(mGrid); monthGroup.appendChild(mCapGrid); monthTabPanel.getChildren().clear(); monthTabPanel.appendChild(monthGroup); // // force that everything is rendered monthTabPanel.invalidate(); // // bookmark where we are currentWLabel.setValue(ldtf.format(monthStarts)); currentMonthView = monthStarts; // return columnDates;

    } }

it is in the auxheaders.

Happy to attach the test files I built to analyze this.

This is a BUG, so how do I raise a bug ticket?

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More