When the Actionbar is collapse for the first time, the ContentViews that contains the Grid, is expanded as expected, but the Grid's width is not recalculate, but keep the same value as before expanded
The reason is, the LayoutManager didn't add the GridConnector to ManagedLayout (layout should be measure in need), and hence the Grid's width was not recalculated as well
But after expand the Actionbar, the LayoutManager adds GridConnector to the list ManagedLayout, so from now on, for every change to layout, the grid will be recalculated.
This could be a bug of vaadin when the grid doesn't work well with expandable layout.
Try these 2 approaches
- Find a proper way to add the GridConnector to LayoutManager com.vaadin.client.LayoutManager#setNeedsHorizontalLayout. This approach requires the understanding of how LayoutManager work.
pros and cons: cannot prove whether it works
- Using Rpc to send an event from ActionbarConnector to tell UI repaints the workbench after the Actionbar is collapsed (e.g using workbench.markAsDirtyRecursive())
- pros: fix the problem
- cons: not ensure the performance if the workbench has too many component