I put this into the class that creates the Frame.  A mouse event in
the primary screen class (which extends AbsolutePanel and has this
object placed on it) calls 'offerControls()' - which will someday.
For now, it's just a quick re-use while I work this out.

It has no effect - the scrollbars are still there.  I do see the
Window.Alert, so I know the call comes through:
public class Underlay extends Frame implements ftWidget
    {
    private String address = null;

    private Underlay()
        {}

    public Underlay( String address )
        {
        this.address = address;
        this.setUrl( address );
//        this.setStylePrimaryName( ".ft-underlay" );
        }

    public void offerControls()
        {
        Window.alert( "Called offerControls" );
        newPageInFrame( this.getElement() );
        }

    native void newPageInFrame( Element frame )/*-{
    var FramePageHeight = framePage.scrollHeight + 10;
    frame.style.height=FramePageHeight;
    }-*/;
    }

Any thoughts?  If I make this Frame arbitrarily big, then there
(usually) won't be scrollbars, but the outer panel would scroll off
into space.  I am bemused there is no way to tell this to size itself
to fit it's contents (what else is it for?).

I did some experiments with  SmartGWT setAutoHeight() but couldn't get
the scrollbars to leave that way either.  If you're certain that would
work, it's worth pursuing.

Any help would be appreciated.

Thanks,
Bret


On Jul 30, 3:22 am, Thomas Dvornik <[email protected]> wrote:
> An easy solution would be to use a 3rd party like SmartGWT. All their
> widgets have a method called setAutoHeight() which will do exactly
> what you want.
>
> However, I haven't tried this, but give it a shot. This might have to
> go in an class that extends Frame.
>
> link.addClickListener(new ClickListener() {
>     public void onClick(ClickEvent event) {
>        changeContentsOfFrame();
>        newPageInFrame(frame.getElement());
>     }
>
> });
>
> native void newPageInFrame(Element frame) /*-{
>   //Remember, JavascriptObject, Element, and the
>   //primitives are directly accessible in JSNI code.
>   //Thus frame here should be -the-frame.
>
>   var FramePageHeight = framePage.scrollHeight + 10;
>   /* framePage is the ID of the framed page's BODY
>    * tag. The added 10 pixels prevent an unnecessary
>    * scrollbar. */
>
>   frame.style.height=FramePageHeight;
>
> }-*/;
>
> Tom
>
> On Jul 28, 10:28 pm, bcw <[email protected]> wrote:
>
>
>
> > Hello,
>
> > I've tried ideas in several posts, but none gets me what I need.
>
> > If I assign a URL to a Frame, and also set a fixed size that is
> > smaller than the resulting page, the Frame provides scroll bars.
>
> > But my Frame is itself embedded in another page which provides the
> > scroll bars.  I want to set the Frame so it is large enough (and only
> > large enough) to render the URL page without any scrollbars, and use
> > the outer page's scroll bars to see it.
>
> > I can't find any way to do this.  I can't find anyway to get the size
> > of the entire page contained within the Frame.
>
> > Please let me know a way to do this.  The Frame is positioned on an
> > AbsolutePanel.

-- 
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.

Reply via email to