Hi,
Why not using the LoadHandler:
Frame f = new Frame();
f.addLoadHandler(new LoadHandler() {
@Override
public void onLoad(LoadEvent event) {
_logger.info("LoadEvent: " + event.toString() + "\n" +
"New URL: " + f.getUrl() + "\n" +
"Relative Element: " +
event.getRelativeElement());
}
});
It doesn't catch the POST parameters, but JS doesn't neither, isn't it?
Cheers,
Thomas
On Wednesday, 16 January 2008 06:21:06 UTC+9, aarnott wrote:
>
> I would like my application to include an iframe and I would like to
> be able to detect when a link has been clicked in that iframe (and
> also get information about the new page). For example, supposing the
> iframe points to http://code.google.com/webtoolkit/, I would like to
> be able to detect when the user clicks a link and then be able to read
> the new page and make the text between the <title> tags be the content
> in a lower panel of my application.
>
> To set the iframe, I am using the following lines of code:
>
> HTML data = new HTML("<iframe src='" + URL + "' style='width:100%;
> height:100%;'></iframe>");
> panel.add(data);
>
> where URL is the url of the page.
>
> I have tried using a click listener:
>
> data.addClickListener(new ClickListener (){
>
> public void onClick(Widget w) {
> System.out.print("click");
> }
> });
>
> But nothing is printed to the console. How can I make this work? Am
> I using the correct approach?
>
> Thanks,
>
> Andrew
On Wednesday, 16 January 2008 06:21:06 UTC+9, aarnott wrote:
>
> I would like my application to include an iframe and I would like to
> be able to detect when a link has been clicked in that iframe (and
> also get information about the new page). For example, supposing the
> iframe points to http://code.google.com/webtoolkit/, I would like to
> be able to detect when the user clicks a link and then be able to read
> the new page and make the text between the <title> tags be the content
> in a lower panel of my application.
>
> To set the iframe, I am using the following lines of code:
>
> HTML data = new HTML("<iframe src='" + URL + "' style='width:100%;
> height:100%;'></iframe>");
> panel.add(data);
>
> where URL is the url of the page.
>
> I have tried using a click listener:
>
> data.addClickListener(new ClickListener (){
>
> public void onClick(Widget w) {
> System.out.print("click");
> }
> });
>
> But nothing is printed to the console. How can I make this work? Am
> I using the correct approach?
>
> Thanks,
>
> Andrew
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/ZC3s5Sz8xogJ.
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.