<a4j:commandButton id="save" value="save"
action="#{objectHome.persist()}"
rendered="#{!objectHome.managed}"
disabled="#{!objectHome.wired}"
oncomplete= "myfunction(#{objectHome.instance.idd})">
</a4j:commandButton>
<script language="javascript" type="text/javascript">
function myfunction(x)
{
window.location.replace("http://localhost:8080/projet/doc.seam?ObjectIdd="+x+" ");
}
/////and in my file.page.xml
<navigation from-action="#{objectHome.persist()}">
<rule if-outcome="persisted">
<end-conversation/>
<redirect view-id="/filepdf.xhtml"/>
</rule>
</navigation>
問題は、保存ボタンをクリックすると、リダイレクトfilepdf.xml
は正常に行われますが、oncomplete
呼び出すことができませんmyfunction
(同じページでのリダイレクトです)。