如何从Orbeon XForms操作调用JavaScript代码?

时间:2018-05-16 15:50:44

标签: orbeon xforms

我想在验证/保存Orbeon表单时执行一些javascript。

根据Scripting Actions: Basic usages

上显示的文档,我添加了这两个代码段
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
         xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
         xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
         xmlns:saxon="http://saxon.sf.net/"
         xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
         xmlns:xf="http://www.w3.org/2002/xforms"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:sql="http://orbeon.org/oxf/xml/sql"
         xmlns:ev="http://www.w3.org/2001/xml-events"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:exf="http://www.exforms.org/exf/1-0"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
         fr:data-format-version="4.0.0">
    <xh:head>

    ...


    <xf:trigger>
         <xf:label>DOM Activate triggered</xf:label>
         <xxf:script event="DOMActivate">
             console.log('DOMActivate');
             alert('DOMActivate');
         </xxf:script>
     </xf:trigger>  
     <xf:action event="xforms-submit-done" type="javascript">
         console.log('xforms-submit-done');
         alert('xforms-submit-done');
     </xf:action>                
 </xh:head>
 <xh:body>

 ...


 </xh:body>
</xh:html> 

但是在加载表单或点击保存按钮时没有任何反应。

我缺少什么?

提前致谢。

0 个答案:

没有答案