List / Repeater Component for Vaadin

In my previous project, I used a BeanItemContainer and a table with GeneratedColumns to easily display a custom component that displays a search result, such as google. Title, date, vertical content. As terrible as it was (table), it worked.

Now I want to use the Grid component for a new project for the same purpose. The column will be created and contains the custom component.

Will this work with the grid? is there something better, like a list or a relay? Any example of a single column with a custom component?

Vaadin seems to be frowning at something other than simple data or button rendering.

Update

It seems that adding components does not work out of the box using Grid 7.5+

In addition, the grid cells must be a fixed height.

The ComponentRederer Add-on supports cell elements, but the height of the fix is โ€‹โ€‹still a problem.

Code example :

public class Result { String title; Date date; URL url; String description; List<String> tags; public Result (){} } BeanItemContainer<Result> resultContainer = fetchResults(searchTerm); 

I also use Lazy Container, beanitem is used for simplicity.

Then I have a RecordResultComponent that builds a layout for one record result in the following layout:

  Title(link with Url) Date Description tag1 tag2 tag3 ... 
+7
vaadin vaadin-grid
source share
1 answer

You can use the grid with the GeneratedPropertyContainer .

You can then use the HtmlRenderer in a custom column.

Hope this helps. :-)

0
source share

All Articles