On Mar 14, 2:30 pm, "Sumit Chandel" <
sumitchan...@google.com> wrote:
> Hi dolcraith,
>
> Could you elaborate a little more on what you're trying to do? GWT
> applications themselves are loaded in iframes, and allow you access to the
> parent document's `window` variable through the Window class.
>
I am having similar difficulties. I have a GWT app which is loaded
from a server I do not control.
My gwt app is invoked in an iframe and appears correctly amongst other
page elements -
I do not need to mess with ( the client has control of them ).
My app is a fairly complex item that does a bunch of paging from the
results of RPC calls.
One page can only display 12 results ( 3 rows x 4 cols ) and
selecting backward <-> fwd
is achieved by hitting some buttons along the bottom of the set, below
the 3rd row.
The prob is that on each refresh I need to scroll the containing page
up a bit
to display the uppermost (4) items instead of just sitting where it
is. The entire page is vertically
longer than most windows display anyway, and my app is 1200px alone.
As you mention below, 'Window.xyz' refers to that of my iframe, not
the container.
So I have experimented with the JSNI solution:
public static native void alert() /*-{
$wnd.alert($wnd.outerHeight);
}-*/;
which does indeed seem to give the correct height of the containing
window,
which tells me I must be referencing the proper object. One would
think I
could also influence the scroll position of that object.
However, I cannot get that window to scroll in any way.
I have seen some references in the group to setting style
overflow={scroll, auto} on the body of the containing doc.
Have not had joy with that ( i can alter the html the client
provides ).
Delivering the app by itself ( not in an enclosing iframe ) works
great and the solution is easy -
by invoking some DOM / Element action and setting the Id Attribute =
'_sort' on one of the items at the top of the list:
DOM.scrollIntoView(DOM.getElementById("_sort"));
I hope that explanation is in clear and on topic.
thanks,
anceaux
> Alternatively, you can access the `window` variable using JSNI (JavaScript
> Native Interface, link below). In your JSNI code, the `$wnd` variable is
> mapped to the parent document's `window` variable. Referring to `window` in
> your JSNI code will use the window variable local to the iframe in which the
> GWT application is loaded.
>
> JavaScript Native Interface:http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.De...
>
> Do any of the above accesses to various `windows` satisfy what you're trying
> to do? If not, please post up more specific on what you're trying to
> accomplish.
>
> Hope that helps,
> -Sumit Chandel
>
> On Thu, Mar 13, 2008 at 12:51 PM, dolcra...@gmail.com <dolcra...@gmail.com>
> wrote:
>
>
>
> > Is there any way of accessing the Browser/Window/Document from within
> > an iFrame in gwt (not native js)?