In vaadin, if I set width and height to undefined, I will get -1 when using getHeight()/getWidth() function.
if I use sizeful(), I will get 100%. But how can I get the exactly width and height of a component?
In vaadin, if I set width and height to undefined, I will get -1
Share
In Vaadin, the layout is realized by the client side engine in the browser and the concrete sizes of layout components usually depend on the size of the browser window. Component sizes are not sent back to the server by the Vaadin standard components.
Since all of your code is executed on the server, it cannot get at those values, either. You would need to program a special wrapper component that sends its size back to the server each time it changes.
Update 2013-03-21: I have developed the SizeReporter add-on for Vaadin 7 which sends back the size of the component to the server and notifies you when the size changes.