Skip to content

Caching generated components possible? #20

@Juchar

Description

@Juchar

If I have a button to show the details row I want to be able to change the icon to "up"/"down" for showing/hiding details.

This does not work right now.

Example ComponentGenerator:

@Override
public Component getComponent(Object bean) {
    Button button = new Button();
    button.setWidth(2, Unit.EM);
    button.setHeight(2, Unit.EM);
    button.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    button.setIcon(VaadinIcons.CHEVRON_DOWN);
    button.addClickListener((Button.ClickListener) event -> {
        boolean detailsVisible = grid.isDetailsVisible(bean);
        event.getComponent().setIcon(detailsVisible ? VaadinIcons.CHEVRON_DOWN : VaadinIcons.CHEVRON_UP);
        grid.setDetailsVisible(bean, !detailsVisible);
    });
    return button;
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions