1

I use RapidClipse 4.
In a view I generated a crosstab table (XdevGrid) with grouped sum rows.
The total were build inside the sql-code.

RowNo      | Detail | Month 1...Month n | total|
1 | A           | 0.5     | 1        | 3 |...           | 4.5 |
2 | A           | 0.8     | 0.2     | 1 |...           | 2.0 |
3 | A Total | 1.3     | 1.2    | 4 |...           | 6.5 |
4 |B ......
5..... a.s.o.

I would like to change the text style of the whole row which includes the totals to bold.
I searched a lot ad found a lot ;-) but my experience is to small to adapt it.
I assumed I can use elements out of Vaadin, because XdevGrid is based on Vaadin 7.
To assign the data to the grid I used following code:

final XdevBeanItemContainer<VUmsCrosstbl2> myContainer = new XdevBeanItemContainer<>(VUmsCrosstbl2.class);
myContainer.addAll(new VUmsCrosstbl2DAO().getAllCrossDataforYearKonto2(selJahr, "7,8"));
this.tblUmsCross.setContainerDataSource(myContainer);


I stil generated a calculated cell and included it in the table.

    package com.opaheinz.rc_07.ui;
    import java.util.Formatter;
    import com.opaheinz.rc_07.entities.VUmsCrosstbl2;
    import com.vaadin.ui.Component;
    import com.vaadin.ui.CssLayout;
    import com.vaadin.ui.Table;
    import com.vaadin.ui.Table.ColumnGenerator;
    import com.xdev.ui.entitycomponent.table.XdevTable;

public class MyFormatIndicator implements ColumnGenerator {

    @Override
    public Object generateCell(final Table table, final Object itemId, final Object columnId) {
        final VUmsCrosstbl2 bean = getBean(table, itemId);
        final String myIndicator = "";

        if (bean.getL1GroupName().toLowerCase().startsWith("<b>"))
        {
            myIndicator = "1";
            // For this case, I would like to change the row style
        } else {
            myIndicator = "0";
        }
        return myIndicator;
    }

I used the generated cell to validate if there is a total or not.
And I created a special style entry v-table-row-total and placed it in styles.scss:

  .v-grid-row.total> td {
 background-color: blue;
 font-weight: bold;

}

This worked fine so far.

But I am not able to access the row style and set it.
I tried to transfer the vaadin examples into my rapidclipse project, but also without success.

Out of this my questions:
Has anyone expierience with XdevTable/ XdevGrid and such a requirment?
Is this still possible?
Could anyone give me a rough example?

Thank you in advance
rgds OpaHeinz

Schwabenheinz
  • 133
  • 1
  • 11

0 Answers0