I ported the
AddressBook tutorial to current beta 3 version of Vaadin 7. Find the source-only archive attached to this post. All other dependencies like Vaadin 7 jars, IDE project environment and theme files are excluded. Strip the Vaadin 6 based
bundle as needed.
Some implementation notes
This implementation uses non-deprecated API only. For example, instead of refactoring half way from legacy Application class to LegacyApplication, the new UI class is used.
The old Form class utilized the FormLayout, which is not deprecated. So make use of it with FieldGroup.
BeanFieldGroup could easily inspect the bean class for properties w/o using an instance of a bean. See comments of mini tutorial
Auto generating a form…
The PersonFieldGroup uses the column captions to modify the fields - this really should be the propertyId. I am missing something here.
The postal code validator moved from a regular expression based one, to an internal Integer-base one. That’s because of a isValidType()-check mismatch that prevent the validator to kick in.
Hi Ondrej, you also can attach updated versions here - as I suspect, that the official address book example will be re-released here at Vaadins, when 7.0 is done. So, no need to have multiple “roots”, read repositories floating around.
I’m just starting out with Vaadin so am trying the addressbook. However the layouts seem to have their spacing really messed up (see attached screenshot). I’m using the source that was linked and everything technically seems to be there. However the Navigation bar instead of being a horizontal list of icons appears vertically, with the Button size not being the dimensions of the image, but 100% of the available width. Equally the list of the header, detail page, whilst technically there seems to take up < 10 pixels. I have tried manipulating the setSplitPosition(…) in the ListView class which can make it appear enough that I can see maybe 1/4 of the row.
I am using version 7.0.0.rc2 of the server and client etc.
I don’t know if the problem is that the code needs to be updated to work with new methods, although it all seems to at least make sense, even if it doesn’t work quite right. Or if there’s an issue with spacing with non production ready code. My guy assumption is that I’ve made a noob mistake. However I am running out of ideas now…
I didn’t have a chance to update to RC2, yet. But your findings smell like “now bad 6.0 style” code. When I started porting the AddressBook tutorial, I didn’t look too deep into the GUI setup.
What does the
?debug console tell you? Are there layout problems noted?