0

I am trying to launch a javascript for adding extra functionality to a form run. The script must be launch when the form is loaded.

The idea is:

 <xxf:script ev:event="xforms-enabled">
         alert('hello world');           
 </xxf:script>

The problem is, as described at the Orbeon Forum, the "xforms-enabled" event is launched several times (for each control and variable). In the forum is described some workarounds and solutions, but cannot be applied when using javascript (or I do not know how to do it).

The question is: how can I execute the javascript code only one time when starting the form? Must I use another event?

4

1 回答 1

1

最好的办法是在 上运行您的脚本xforms-ready,该脚本已发送到模型。所以你会在你的<xf:model>

<xxf:script ev:event="xforms-ready">...</xxf:script>
于 2013-10-16T22:15:47.310 回答