In Orbeon Forms, you typically call client-side JavaScript from actions with the <xxf:script> extension action or with <xf:action type="javascript"> (which is now the preferred way). For example, the Currency XBL component has a call like this:
<xxf:script>Until now if you used more than one instance of the currency component in your page, the inline scripts would be duplicated multiple times on the client.
YAHOO.xbl.fr.Currency.instance(this).setfocus();
</xxf:script>
Now, with this enhancement, each script body is associated a SHA1 hash based on its content, and a given script body is sent to the browser only once. This means less duplication of code.
Here is the documentation on <script> and <action> actions for scripting. And if you are interested in the implementation, here is the git commit, in particular PartEventHandlerAnalysis.scala.
No comments:
Post a Comment