Getting Height of cell table

50 views
Skip to first unread message

Eric

unread,
Feb 2, 2011, 3:44:35 PM2/2/11
to Google Web Toolkit
Hello,

Is there any reliable way of getting the height of a cell table when
it changes? I have a navigation panel to the left of my main content
panel. If the main content is shorter than the current height of the
nav panel I set it's height in pixels; when the content is at least as
tall I set the height back to "auto".

The problem that I'm having is that at the point I'm calling
"content.getOffsetHeight();" (content is a vertical panel that
contains the cellTable) the cell table is small. Then moments later
the cell table fills with rows and is big again. Is there any event
that I could add a handler to that would fire when the cell table
actually draws?

I'm using 2.1.0. I'd happily change to 2.1.1 but this issue, which
exists in 2.1.0 but is worse in 2.1.1 is keeping me from upgrading.

Thanks,
Eric

BST

unread,
Aug 16, 2011, 7:18:26 AM8/16/11
to google-we...@googlegroups.com
Any Solutions for this problem?

BST

unread,
Aug 17, 2011, 6:09:45 AM8/17/11
to google-we...@googlegroups.com
Managed to find a solution: updating it below.

I am adding a handler to the celltable when the celltable updates it rowdata automatically a valueChange event is fired, so making use of it. Had to go thru the source code for this.

.addHandler(new ValueChangeHandler<MyDTO>() {

        @Override
        public void onValueChange(
                ValueChangeEvent<MyDTO> event) {
            CellTable<MyDTO> table
                = (CellTable<MyDTO>) event.getSource();
           

            String height = 231 + table.getOffsetHeight() + "px";
           
            Window.alert("Value Change Height " + height);
           
        }
       
    },ValueChangeEvent.getType() );
Reply all
Reply to author
Forward
0 new messages