oncomplete无法执行我的javascript函数

时间:2013-04-15 12:22:03

标签: javascript tags

     <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(这是同一页面中的重定向)。

0 个答案:

没有答案