CellList inside a panel of 100% height

61 views
Skip to first unread message

Magnus

unread,
Feb 22, 2015, 10:18:34 PM2/22/15
to google-we...@googlegroups.com
Hi,

consider the CellList example in GWT showcase:


The CellList in this example has a fixed height of 400 px.
If you change it to 100%, the scrollbars are gone!
(You can verify this right in the showcase example.).

However, I would like it to fill the whole height.
What can I do?

Thanks
Magnus

Tushar Bhasme

unread,
Feb 24, 2015, 10:30:50 AM2/24/15
to google-we...@googlegroups.com
table.setHeight(String.valueOf(Window.getClientHeight() - (the amount of px you want to leave from top)) + Unit.PX);

Thanks,
Tushar

Magnus

unread,
Feb 25, 2015, 12:56:09 PM2/25/15
to google-we...@googlegroups.com
Thank you very much! This works!

I don't know why, but I the parent's height is too much, so that I have to substract 10 pixels to make it fit.

The panel is located in an UIBinder with a HTMLPanel as root. So I used getParent().getOffsetHeight().
Any ideas why this is not exactly the client height?

And why does the panel with the CellList have to be fixed-sized?

Thanks
Magnus

tushar bhasme

unread,
Feb 25, 2015, 1:36:43 PM2/25/15
to google-we...@googlegroups.com
I guess the height here is set to enable scrolling if data exceeds the given pixels.


Thanks,
Tushar Bhasme

--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/zTeA3Ziu9CU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Jens

unread,
Feb 25, 2015, 2:06:55 PM2/25/15
to google-we...@googlegroups.com
The panel is located in an UIBinder with a HTMLPanel as root. So I used getParent().getOffsetHeight().
Any ideas why this is not exactly the client height?
 
clientHeight includes padding
offsetHeight includes padding, borders and scrollbars

 
And why does the panel with the CellList have to be fixed-sized?

You can also use 100% on the ScrollPanel if any parent is limited in size.


-- J.

Magnus

unread,
Feb 26, 2015, 12:54:19 PM2/26/15
to google-we...@googlegroups.com


On Wednesday, February 25, 2015 at 8:06:55 PM UTC+1, Jens wrote:
The panel is located in an UIBinder with a HTMLPanel as root. So I used getParent().getOffsetHeight().
Any ideas why this is not exactly the client height?
 
clientHeight includes padding
offsetHeight includes padding, borders and scrollbars

Ok, but even getElement().getClientHeight is a few pixels too large:


It's ok for me to substract some pixels, but I wonder why getClientHeight does not return the exact value...

And why does the panel with the CellList have to be fixed-sized?
You can also use 100% on the ScrollPanel if any parent is limited in size.

What's limited size? All parents are resizable by the user, but at any point in time the parent's client size is limited...

For example, if I use a table with 100% height, it works... but not with the CellList...

Magnus
Reply all
Reply to author
Forward
0 new messages