Spreadsheet very small?

I tried to integrate the Spreadsheet add on into our project using the demo code from the book of vaadin:

[code]
compositionRoot = new VerticalLayout();
Spreadsheet spreadsheet = new Spreadsheet();
spreadsheet.setWidth(“400px”); // Full size by default
spreadsheet.setHeight(“250px”);

// Put customary greeting in a cell
spreadsheet.createCell(0, 0, “Hello, world”);

// Have some numerical data
spreadsheet.createCell(1, 0, 6);
spreadsheet.createCell(1, 1, 7);

// Perform a spreadsheet calculation
spreadsheet.createCell(1, 2, “”); // Set a dummy value
spreadsheet.getCell(1, 2).setCellFormula(“A2*B2”);

// Resize a column to fit the cell data
spreadsheet.autofitColumn(0);

compositionRoot.setSizeFull();
compositionRoot.setSpacing(true);
compositionRoot.setMargin(true);

compositionRoot.addComponent(spreadsheet);
[/code]When I try to look at it this is how it is displayed:

What am I doing wrong?

Hi,

Have you checked if the theme was updated to include spreadsheet theme?

If it was updated addonss.scss should look like:

[code]
@import “…/…/…/VAADIN/addons/spreadsheet/spreadsheet.scss”;

/* Import and include this mixin into your project theme to include the addon themes */
@mixin addons {
@include spreadsheet;
}
[/code]If it’s not updated and you are using maven you can run:

mvn vaadin:compile-theme Once it’s updated if you have runtime theme compilation you need to be sure it’s not cached by force refreshing in your browser window.

If you have compiled your theme previously you have to re-compile it. With maven you compile it with:

mvn vaadin:compile-theme Or if you’re using the Vaadin Plugin for Eclipse there’s a “Compile Theme” button.

Hope this helps!

Thank you for your reply. I tried:

  • Checking the addons.scss. It looked exactly like your snippet
  • Running mvn vaadin:compile-theme twice and using that widgetset.
  • Empyting the entire browser cache, including cookies and using the incognito mode of the browser

But it still looks like shown above. Any other ideas? During the theme compilation it said “License for Vaadin Spreadsheet 1 has not been validated. Check your network connection.”. Can that have something to do with it? I don’t understand this message though, there is a valid internet connection.

As Guille said, this looks like a theme issue. Are you sure you are using the theme where you added the addon file? Do you have multiple themes in your project? Could you also double-check the style file that gets loaded into the browser for anything related to ‘spreadsheet’?

Johannes, have you installed Vaadin Spreadsheet license?
The information how to do it, is
here

Yes that was the issue. It did compile a new addons.scss, but I only copied the widgetset not the new theme file. Now it works. Terribly sorry for the fuss I created.

Good thing you got it to work, and don’t worry about the fuss. Now someone else will have the answer here :slight_smile: