using onComplete event's and pages.xml
<p>I have an "a4j:commandButton" that runs some JavaScript on an "onComplete" event.
There is also an "action" that is calling a method.</p>

<pre><code>&lt;a4j:commandButton action="#{Bean.Method()}"
onComplete="thisJavaFunction()"&gt;
</code></pre>

<p>I am using pages.xml in Seam to change to a separate page when that method is called.</p>

<pre><code>&lt;page view-id="/webpages/page1.XML"&gt;
    &lt;navigation from-action="#{Bean.Method()}"&gt;
        &lt;redirect view-id="/webpages/page2.XML"/&gt;
&lt;/page&gt;
</code></pre>

<p>Problem:</p>

<p>I want "thisJavaFunction()" in the onComplete method to be called when page2 is loaded.
However because it is a separate page, the onComplete event does not occur.</p>

<p>I could use an onLoad event in the body of page2, but i would rather not use this because page2 uses a template that other pages use (e.g page1), this means that when other pages are called than the onLoad event is called.</p>

<p>Is there anyway to get around this?</p>

<p>Thank you,
Scott</p>
