Vaadin 7 beta 9 released


SingleComponentContainer introduced

Based on received feedback and API review meetings we have decided to do some last minute changes to the API. The most noticeable change comes from correcting the broken component hierarchy in Panel, Window and UI - a problem introduced a long, long time ago. There is no longer any addComponent/removeComponent in these components, instead the getContent/setContent methods must be used. There is also no (confusing) default content added to these. Old code such as

[code]
Panel p = new Panel();
p.addComponent(new Label(“Hello”));

[/code]can be changed either to

[code]
Panel p = new Panel();
p.setContent(new Label(“Hello”));

[/code]or

Panel p = new Panel();
VerticalLayout layout = new VerticalLayout();
p.setContent(layout)
layout.addComponent(new Label(“Hello”));

Panel/Window/UI all implement a new SingleComponentContainer interface and will accept any component as their (only) child (as opposed to only ComponentContainers in earlier versions).


Minor API changes

Page.setFragment/getFragment and related methods have been changed to use “UriFragment” instead of “Fragment” to avoid confusion in the future.

ComponentContainer implementors should implement iterator() instead of the deprecated getComponentIterator().

The old “v-view” style name for UI has been replaced by a more appropriate “v-ui”.


Better UIBinder compatibility

To be improve compatibility with UIBinder and similar tools, the client side widgets have been moved into the com.vaadin.client.ui package. Re-organize your imports if necessary.


Compatible with Internet Explorer 10

Internet Explorer 10 now works correctly but is for the moment run in IE 9 compatibility mode. We are still working on getting our automated tests run on IE 10 to be able to find and fix issues when running in native IE 10 mode.


Bug fixes

There are numerous bug fixes included in this version. Especially the SASS compiler has been significantly improved.


For short examples on how to use the new features, check out the Vaadin 7 mini tutorials:
https://vaadin.com/wiki/-/wiki/Main/Vaadin+7

For information on how to migrate from Vaadin 6 to Vaadin 7, see
http://dev.vaadin.com/wiki/Vaadin7/MigrationGuide

This is an beta release so we expect there to be bugs. We will no longer be making large new features but finalization of the current features might still affect API in some places. All your comments on the new features are welcome. Please post all Vaadin 7 related comments in the Vaadin 7 category.

Great! This is much more transparent now.

How is the Navigator to be instanciated now, from a UI, since getContent() doesnt work there anymore?

Ah I figured it out, for example setContent(new VerticaLayout) in the UI init, before the Navigator instantiation, does the trick. Is that the right way to do it?

Navigator now also has a SingleComponentContainerViewDisplay and a constructor that takes a SingleComponentContainer as the second parameter.

Thus, when initializing a UI, you can use
new Navigator(this, this)
or
new Navigator(this, myPanel)
.

Do I see right that there is even no “removeallcomponents” anymore? Is there another way to achieve the same goal?

SingleComponentContainer has getContent and setContent. To remove the content, use setContent(null). But keep in mind that removeAllComponents in e.g. UI did not remove the UI contents but instead the components from the layout inside the UI (by default a VerticalLayout()). To do this, you need to get the layout (e.g. by casting getContent() if you know the UI contains a layout) and doing removeAllComponents on that.

Thanks for your support. I will try this. I need to do this in some places to clean up the instances that I got injected via CDI.