determine the current size of a FlexTable in GWT

271 views Asked by At

I need to know the current size of a FlexTable in order to resize a DialogBox accordingly (FlexTable lives inside the DialogBox). I did not find a way to do that automatically, but I would at least want to be able to do it manually be determining the height and the width of the FlexTable and then resize the DialogBox accordingly. Does anybody know how to do that?

2

There are 2 answers

3
Maksym Demidas On BEST ANSWER

Try to call getOffsetHeight() and getOffsetWidth() methods on corresponding FlexTable.

0
TomS On

I think I've found it out just now. Its the following method of the FlexTable class:

FlexTable ft = new FlexTable(); 
... 
int width = ft.getElement().getStyle().getWidth(); 
int height = ft.getElement().getStyle().getHeight();

But that still does not work with my DialogBox issue. It's still not resized. I'll ask that in a separate question.