tags:

views:

28

answers:

0

I have an "a4j:commandButton" that runs some JavaScript on an "onComplete" event. There is also an "action" that is calling a method.

<a4j:commandButton action="#{Bean.Method()}"
onComplete="thisJavaFunction()">

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

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

Problem:

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.

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.

Is there anyway to get around this?

Thank you, Scott