简体   繁体   中英

Vaadin flow - Grid column empty

Vaadin 11.0.1

Layout is one top grid and to bottom grid (one on left, one on right)

Here is how I create my page:

public class InformationMainView extends VerticalLayout {
    private Grid<AdmisRejet> gridRejet = new Grid<>();
    private Grid<Entry<String, String>> admisPropertiesGrid = new Grid<>();
    private Grid<AdmisHistory> gridJobHistory= new Grid<>();

    public InformationMainView() {

        // history (top)
        gridJobHistory.setItems(admisHistoryRepository.findAllByOrderByJobExecutionDateDesc());
        gridJobHistory.addColumn(AdmisHistory::getJobExecutionDate).setHeader("Date Importation");
        gridJobHistory.addColumn(AdmisHistory::getCreatedBy).setHeader("Par");
        gridJobHistory.addColumn(AdmisHistory::getUai).setHeader("UAI");
        gridJobHistory.addColumn(admisHistory -> admisRejetRepository.findAdmisRejetByAdmisHistory(admisHistory).size()).setHeader("Nb Rejets");

        // reject (bottom left)
        gridRejet.addColumn(AdmisRejet::getTypeRejet).setHeader("Type rejet");
        gridRejet.addColumn(AdmisRejet::getInformation).setHeader("Valeur");
        gridRejet.addColumn(getBlockingIconRenderer()).setHeader("Bloquant");

        // details (bottom right)
        admisPropertiesGrid.addColumn(Entry::getKey).setHeader("Clé");
        admisPropertiesGrid.addColumn(Entry::getValue).setHeader("Valeur");

        add(gridJobHistory, new HorizontalLayout(gridRejet, admisPropertiesGrid));

The bottom are not render (not even the headers). There is no data in them (normal, because data are populated when I click on the top grid).

But I expected to see at lest column headers...

Here is the render: 在此处输入图片说明

I made it work by forcing the width:

HorizontalLayout bot = new HorizontalLayout();
bot.setWidth("100%");
bot.add(gridRejet, admisPropertiesGrid);
add(gridJobHistory, bot);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM