Hey Bret,

Did you ever figure out the solution to this?

I played around with it and could not get the native js to work
either. After searching, there isn't a way to do it for pages not on
your domain. If the page is in your domain, search how to make frames
adjust to their contents, and add the function directly in the page.
Then in the class, have the native js function call that other
function in the page. Kinda a weird workaround but should work unless
the pages are hosted somewhere else.

After seeing these restrictions, it probably wouldn't work in SmartGWT
either. If you do try it though, make sure you wrap the whole page in
a window or layout, have that do auto height, and the frame have auto
height. That way, the outer page will scroll if the frames contents is
two big for it, but all the contents should be in that page, and not
scrolling in the frame.

Tom

On Jul 30, 1:35 am, bcw <[email protected]> wrote:
> 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,ThomasDvornik<[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