Oh, in your use case, Alex, you do have an event - adding an item to the panel. Just check the height after new item added and set the height of the ScrollPanel in pixels if max value reached I would think answers.
I have looked in vain for a general method to get ScrollPanels to resize and generally behave by themselves. I think the reason is that individual divs/table cells etc do not generate events when their size changes. ScrollPanel is basically a div with an overflow setting. I have supposed this is because there can be hundreds if not thousands of boxes on a page, so if they all emitted an event every time they changed their width/heights the browser's event queue would be brought to its knees. On Feb 5, 4:13 pm, Litty Preeth <preeth.h...@gmail.com> wrote: > there is some max-height CSS property. But dont know if it works. > > On Thu, Feb 5, 2009 at 8:59 PM, alex.d <alex.dukhov...@googlemail.com>wrote: > > > > > On 5 Feb., 16:10, gregor <greg.power...@googlemail.com> wrote: > > > Hi Alex, > > > > I think you have to explicitly specify the height of a ScollPanel in > > > pixels to get the scroll bars to kick in, and that will set the height > > > of the panel from the word go. If what you mean is that you want a > > > panel to start at a minimum size, then grow as things are added to it, > > > but then to stop growing and go into scroll mode at a certain point, > > > exactly what i meant. > > > > I do not think that is realistically possible since there is no event > > > you can listen for that would tell you when the panel had grown to a > > > given height. You can listen for the browser window changing, but not > > > for an individual panel. > > > > I suppose one approach might be to set up a timer to check the current > > > height at intervals and take appropriate action when it hit the limit, > > > but this sounds very inefficient. > > > Indeed it does. I kind of hoped somebody will have a genious idea > > about it ;-) Thank you for your input anyway. > > > > regards > > > gregor > > > > On Feb 5, 9:29 am, "alex.d" <alex.dukhov...@googlemail.com> wrote: > > > > > Hi folks, > > > > I'm trying to impelement a scrollpanel that becomes bigger (height) to > > > > the certain size (maxHeight) when populating it with data. After that > > > > vertical scrollbar should appear and the panel should stop growing. > > > > Any ideas on how to implement this would be appreciated. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---