You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by itayh <it...@attractv.net> on 2008/11/02 15:44:02 UTC

Refresh parent page from an iframe

Hi,

I have a page that contains several iframes with some actions in each
iframe. When I press on some of the actions I want the parent page to be
updated (since the actions affect the whole parent page with the iframes).
But every attempt to update the page is actually updating the iframe only.
What actually happen is that the whole page get render again inside the
iframe. I use setResponsePage(parent) within the iframe. Thats probably the
problem but I don't know what else to use.  
I try to do as it written
here:http://www.nabble.com/modal-window-navigation--td18551902.html but it
does not work.

Any idea's?

Thanks in advance,
  Itay

-- 
View this message in context: http://www.nabble.com/Refresh-parent-page-from-an-iframe-tp20290367p20290367.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Refresh parent page from an iframe

Posted by Bert van Heukelom <be...@weewar.com>.
There is an example Implementation of a file upload, that is contained in an
iFrame (
http://www.demay-fr.net/blog/index.php/2007/12/07/93-simulate-ajax-file-upload-with-wicket).
The Author wanted pretty much the same as you do: Alter the containing
(parent) page. He uses a javascript call to the parent page. I'm not really
sure if I can get all necessary steps together but here are some hints:

1) Add an AbstractDefaultAjaxBehavior to your parent page. Alter the
"getCallback" method in a way that it makes a call to wicketAjaxGet and
appends parameters to the query string to identify which iframe triggered
the action. Take the query parameters from the current javascript scope.

2) Generate a method into the parent page that executes the getCallback
script of the behavior and takes the parameters needed as function
parameters.

3) append javascript to the submit button/whatever of the iframe that calls
the javascript method in the parent page and pass the parameters that
identify the calling iframe (maybe markup id?).

4) put java code that modifies your parent page into the
AbstractDefaultAjaxBehavior's onResponse method and alter the page.

That is the idea. Hope you can follow me. I'd advise you to take a closer
look at the example by Monsieur Demay. Even though it contains some errors.
There is a corrected version somewhere on the web.

I'd say that there is no direct way using only java to solve your problem.
But I've started using wicket 6 weeks ago so there might be a more clever
answer :)

Cheers

Bert


2008/11/2 itayh <it...@attractv.net>

>
> Hi,
>
> I have a page that contains several iframes with some actions in each
> iframe. When I press on some of the actions I want the parent page to be
> updated (since the actions affect the whole parent page with the iframes).
> But every attempt to update the page is actually updating the iframe only.
> What actually happen is that the whole page get render again inside the
> iframe. I use setResponsePage(parent) within the iframe. Thats probably the
> problem but I don't know what else to use.
> I try to do as it written
> here:http://www.nabble.com/modal-window-navigation--td18551902.html but it
> does not work.
>
> Any idea's?
>
> Thanks in advance,
>  Itay
>
> --
> View this message in context:
> http://www.nabble.com/Refresh-parent-page-from-an-iframe-tp20290367p20290367.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>