Vaadin 7 and the V-Components

Hi All,

atm Im trying to write some custom widgets with Vaadin 7.

Is there any way to extend MyComponentWidget by the vaadin V-Components such as VTextField
or do I have to use the basic gwt components like TextBox, like shown at the tutorials?

I tryed it with VTextField but I had to override the onFocus method, cause else I would have got a nullpionter exception, what is caused by the using of an ApplicationConnection in VTextField.

Also I have a general, version independent, question.
Is there any way too use objects out of other packages, when I write custom widgets?
For example I want to use my own Stringconvereter in my Connector class. But the Connverter is stored at my util package and I dont want to have the same code writen at my client and util package.

Hope you can help me.



You should be able to extend V-classes. Doing an empty extension of VTextField (and the server counterpart) should act just the same way as a normal TextField, and then you can start making changes to it. Notice however that some parts are private, which can turn extending into an no-go. You can always copy the code in these situations and modify that code.

Vaadin 7 has introduced a new way of doing client side widgets. Unfortunately the Vaadin team hasn’t had time to convert the existing components to this new way, so all except VButton and VLabel are still using the Vaadin 6 way. This will hopefully change somewhat before Vaadin 7 final version is released.

About referencing code in different packages: only the gwt part of the source tree will be compiled from Java to Javascript. That means that you have to have the code your referencing to somewhere inside the gwt part of the source folder. A common practice in the cases where you need the same code in both server and client, is to put the code in the client packages, and reference to them also on the server side. Client package code can be called on the server side but not vice versa.

Thanks for the fast response, you hellped me a lot!