Hi.

I'm making some progress by using an IPageLink to a page that might contain
(if I can) the rendered content... HHmm...

Cheers, Graeme.


Graeme Knight wrote:
> 
> Hi.
> 
> I have an application with links that switch panels using AJAX:
> 
>     :
>     private Panel currentPanel;
>     :
>     ContactsListPanel manageContactsPanel = new ContactsListPanel();
> 
>     currentPanel.replaceWith( manageContactsPanel );
> 
>     currentPanel = manageContactsPanel;
>     :
> 
> One of my panels has an IFRAME on it which I wish to populate with content
> on rendering. I would like to set the innerHTML through Javascript, rather
> than set the SRC (the innerHTML will be injected with content that is
> modified on the server and not a static source page).
> 
> I have a Javascript function that can be called once the IFRAME has
> (effectively) been rendered (using a Variables Model for replacing
> 'originalContent' with text):
> 
> function initializeIFrameArea()
> {             
>       IFrameArea.populateContent( "${originalContent}" );
> }
> 
> The populateContent function simply sets the innerHTML on the IFRAME. The
> 'originalContent' is my modified content to be injected into the
> innerHTML.
> 
> My question is this:
> 
> 1) On entering the panel, I was wondering if it is possible to use a
> HeaderContributor (i.e. this is NOT a full page rerender) to add the
> script containing the IFrameArea Javascript on which the populateContent
> is called. I can't have the initializeIFrameArea function on the page from
> the start because I am using a Variables Model to change the value of
> originalContent on the fly (i.e. when the user enters this panel the
> content could be one of many possibilities).
> 
> 2) On rendering I want to be able to call initializeIFrameArea, but I do
> not understand how I can get this into the HTML of the panel so that it
> calls the function after the IFRAME is effectively rendered and innerHTML
> exists.
> 
> Perhaps there is a better approach - as this seems complicated (I had to
> do this with Tapestry, so I'm not sure if Wicket has a more elegant
> approach).
> 
> Any thoughts most welcome.
> 
> Thanks, Graeme.
> 

-- 
View this message in context: 
http://www.nabble.com/Populate-IFRAME-innerHTML-on-AJAX-load-of-panel.-tp20887803p20888407.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to