Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

fixes #8 - treating all container the same way on value extraction #10

Open
wants to merge 1 commit into
base: vaadin7
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -981,39 +981,17 @@ protected void addGenericDataRow(final Object[] visibleColumns, final XSSFWorkbo
}

}
else if (componentConfiguration.getGrid() != null && componentConfiguration.getGrid()
.getContainerDataSource() instanceof IndexedContainer) {
else if (componentConfiguration.getGrid() != null) {
obj = componentConfiguration.getGrid()
.getContainerDataSource()
.getContainerProperty(itemId, visibleColumns[columns])
.getValue();
}
else if (componentConfiguration.getGrid() != null && componentConfiguration.getGrid()
.getContainerDataSource() instanceof GeneratedPropertyContainer) {
if (((GeneratedPropertyContainer) componentConfiguration.getGrid()
.getContainerDataSource()).getWrappedContainer() != null) {
obj = ((GeneratedPropertyContainer) componentConfiguration.getGrid()
.getContainerDataSource()).getWrappedContainer()
.getContainerProperty(itemId,
visibleColumns[columns])
.getValue();
}
}
else if (this.methodMap.containsKey(String.valueOf(visibleColumns[columns]))) {
// This condition takes care of the first level properties of the bean
obj = this.methodMap.get(String.valueOf(visibleColumns[columns]))
.invoke(itemId);
}
else if (componentConfiguration.getGrid() != null && componentConfiguration.getGrid()
.getContainerDataSource() instanceof BeanItemContainer) {

// These properties cannot be taken care by the above method map solution
// This code is mainly to include the nested properties
obj = componentConfiguration.getGrid()
.getContainerDataSource()
.getContainerProperty(itemId, visibleColumns[columns])
.getValue();
}

Cell myCell = myRow.createCell(columns, XSSFCell.CELL_TYPE_STRING);

Expand Down