I see,
I will try it - thank you all for your help.
On 6 Feb., 19:32, gregor <[email protected]> wrote:
> Oh right...
>
> I think you've got to make sure that the whatever the ScrollPanel
> contains has actually reduced in size already - if it hasn't the
> ScrollPanel will refuse to cooperate (i.e. it won't squash it's
> contents by itself). Then you need to reset it to "1px" more than the
> height/width of its contents (1px is fine if contents is now 0) in
> order to get rid of the scroll bars ("0px" etc is ignored as I
> recall). It won't do that by itself. After that you'll have to try
> things out - I've always reset ScrollPanel's to a specific height
> after this procedure, so I don't know how to release it from the "1px"
> instruction without specifying another. I think I would use debugger
> to find out exact style properties of ScrollPanel whilst it's in
> growing mode to start with, and attempt to replicate that. If it has
> nothing in height/width you may have a problem because, as you say,
> you may not be allowed to actually remove a style attribute once it's
> there, only modify it, in which case the ScrollPanel may stubbornly
> refuse to cooperate.
>
> You might be forced to attempt a detach of the items widget, replace
> ScollPanel with a new one, and reattach the items widget to it, or
> some such.......
>
> .... or you might consider another way to do this altogether -
> ScrollPanel's can be tiresome, uncooperative widgets at times ;-)
>
> On Feb 6, 3:46 pm, Davsket <[email protected]> wrote:
>
> > well, at least replace it..
>
> > On 6 feb, 10:41, "alex.d" <[email protected]> wrote:
>
> > > Haven't found one either. But checking height while adding elements is
> > > ok - have it almoust working already. Well, almoust - the problem is
> > > that when height or width properties are set once, you can't take it
> > > back. So, while panel shows the desired behaviour while adding
> > > elements, it remains "big" when elements are removed. I've already
> > > tried:
>
> > > scrollPanel.setWidth("");
> > > scrollPanel.setWidth(null);
>
> > > but no luck. I've also tried to set the style-attribute directly with
>
> > > DOM.setStyleAttribute(scrollPanel.getElement(), "width", "");
>
> > > but no luck either.
> > > Sadly, i haven't found a "removeStyleAttribute"-method.
>
> > > Any ideas?
> > > Thx
>
> > > On 6 Feb., 15:23, gregor <[email protected]> wrote:
>
> > > > > Is there a real browser-event or should i
> > > > > just call a check procedure whenever i add elements?
>
> > > > The latter, no browser event available AFAIK.
>
> > > > > > 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 <[email protected]> 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
> > > > > > > <[email protected]>wrote:
>
> > > > > > > > On 5 Feb., 16:10, gregor <[email protected]> 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" <[email protected]>
> > > > > > > > > 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---