vaadin] how to Showing extra data for Grid rows

I used grid component, and added row details..

However grid doesn't show details..

It's my code.

==== Grid grid = new Grid("Plain Grid");

grid.setDetailsGenerator(new DetailsGenerator() {
        @Override
        public Component getDetails(RowReference rowReference) {
            // Find the bean to generate details for
            final TrainingMemberVo bean = (TrainingMemberVo) rowReference.getItemId();

            // A basic label with bean data
            Label label = new Label("Extra data for " + bean.getMemberName());


            // A button just for the sake of the example
            Button button = new Button("Click me", new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    Notification.show("Button clicked for " + bean.getMemberName());
                }
            });

            // Wrap up all the parts into a vertical layout
            VerticalLayout layout = new VerticalLayout(label,  button);
            layout.setSpacing(true);
            layout.setMargin(true);
            return layout;
        }
    });

    grid.addItemClickListener(new ItemClickListener() {
        @Override
        public void itemClick(ItemClickEvent event) {
            if (event.isDoubleClick()) {
                Object itemId = event.getItemId();
                grid.setDetailsVisible(itemId, !grid.isDetailsVisible(itemId));
            }
        }
    });

===

double clicked row, noting shows details..

Answers


Works for me without any issues. Have you checked if the event in the itemClick() is correctly fired? I. e. remove the boolean check for event.isDoubleClick() to see if it gets executed.


Need Your Help

MYSQL mass deletion FROM 80 tables

mysql transactions dependencies

I have 50GB mysql database (80 tables) that I need to delete some contents from it.

AS3 preloader sorrows, unable to load symbols from library

actionscript-3 movieclip preloader

I created an AS3 preloader, and placed the code for that on frame one.