Extend TextField component

Hi,

I wanted to get more familiar with what’s under the Vaadin hood and GWT widgets. So, I decided that I wanted to start by extending the TextField component. I used the Eclipse wizards which created all the stubs I needed. Now, one of the things I’m wanting to do is customize the component validation icon that is being displayed when there is a validation error for the component so that my new custom component can conditionally display one icon or the other. I’m stumped right now and I need some help to point me in the right direction for customizing that.
Thanks…

Hi,

On the Vaadin client side, updating generic component features (caption, icon, error indicator, style names, sizes, visibility etc) is delegated to ApplicaionConnection, which then again delegates some (caption, icon and error indicator) to layouts that contain the actual the component. We have done this to make implementing simple components as easy as possible.

So if you need to customize something related to error icon, you should modify the layout you are using. Or you can modify the call to ApplicationConnection so the it will skip updating caption, icon and error indicator (the last boolean flag, in updateComponent method).

cheers,
matti

Thanks for the reply…
I traced some of the Vaadin code. I understand there is a balancing act between making it easy to implement simple components and making changes to the fundamental UI scheme of Vaadin. I think it’s fair to say that what I am trying to do is not a trivial enhancement to a TextField; rather, it’s more of a shift in how Vaadin’s UI is designed. To do the enhancement as you suggested would require customizing a layout…which is a little more than I hoped to do with this experiment.