nested Grid (or colspan)


first at all I have to say I like the new Grid API. It seems very flexible and I was looking to use it for a long time. I want to update my old nested table solution which isn’t working good at all.

I have a list of beans I want to visualize (no editing needed, it’s read only).

Class A {
  Date date;
  String name;
  Set<B> bs;
Class B {
  A a;
  String field;
  String fieldValue;

So my Idea is to build a table like this:

     |      | field | fieldValue
5.3  | ab   | f1    | 3
     |      | f2    | hi
     |      | f3    | test
7.6. | ab   | f2    | hello
     |      | f3    | test again

I hope you got the idea :wink:
With table I built a table inside a table. That had the bad side effect the inner table columns are not sized same exactly. Also there was a repeating header. With Grid I hoped to have some ways to achieve this. So after some disillusioning experiements (yeah I know, Grid and Table are row/bean based) I tried to nest Grid like this

getColumn("bs").setRenderer(new GridRenderer(), new SetToGridConverter())
class GridRenderer extends AbstractRenderer<Grid>

the SetToGridConverter creates a Grid at convertToPresentation

The exception I get is “Cannot remove converter, as renderer’s presentation type com.vaadin.ui.Grid and column’s model java.util.Set type aren’t directly compatible with each other”.

Do you have an idea how I could solve this issue or do you have a nice workaround?

I want to show a collection or a collection structured for each item inside a Grid.

Thanks a lot!

"Hi Wolfgang

Your forum post is still unanswered :frowning:

Your forum post titled nested Grid (or colspan) has been unanswered for 10 days now. That is a shame."

Sweet email but I see it’s against the per bean strategy of Grid/Table.