Dear Support,
We have the following problem with list grids when grouping is enabled.
Please have a look on the following very simple code:
The problem: it seems that the optiondatasource column value mapping is not invoked when grouping on the first column... so the grouped value shows the ID instead of the corresponding display value... which is not the expected behaviour.
Note that the problem is exactly the same if we set a value formatter on the column... which will not be called to display the group value:
In both cases, the ID is displayed.
Thanks,
Thomas
We have the following problem with list grids when grouping is enabled.
Please have a look on the following very simple code:
Code:
DataSource.load(new String[] {DSOperator.DS_NAME, DSBusinessUnit.DS_NAME} , new Function() { @Override public void execute() { ListGrid grid = new ListGrid(DataSource.get(DSOperator.DS_NAME)); grid.setAutoFetchData(true); grid.setFields(new ListGridField(DSOperator.BUNIT_ID, "Business Unit"), new ListGridField(DSOperator.NAME, "Name")); grid.getField(DSOperator.BUNIT_ID).setOptionDataSource(DataSource.get(DSBusinessUnit.DS_NAME)); grid.getField(DSOperator.BUNIT_ID).setValueField(DSOperator.ID); grid.getField(DSOperator.BUNIT_ID).setDisplayField(DSOperator.NAME); VLayout test = new VLayout(); test.setWidth(600); test.setHeight(400); test.addMember(grid); test.draw(); } }, true);
Note that the problem is exactly the same if we set a value formatter on the column... which will not be called to display the group value:
Code:
DataSource.load(new String[] {DSOperator.DS_NAME, DSBusinessUnit.DS_NAME} , new Function() { @Override public void execute() { ListGrid grid = new ListGrid(DataSource.get(DSOperator.DS_NAME)); grid.setAutoFetchData(true); grid.setFields(new ListGridField(DSOperator.BUNIT_ID, "Business Unit"), new ListGridField(DSOperator.NAME, "Name")); grid.getField(DSOperator.BUNIT_ID).setCellFormatter(new CellFormatter() { @Override public String format(Object value, ListGridRecord record, int rowNum, int colNum) { return "TEST" + value.toString(); } }); VLayout test = new VLayout(); test.setWidth(600); test.setHeight(400); test.addMember(grid); test.draw(); } }, true);
Thanks,
Thomas
Comment