Search code examples
orbeon

How can I call a JavaScript function from an Orbeon button?


I configured a custom button that sends Orbeon data to a service. After the send is complete, I would like it to execute a JavaScript function.


Solution

  • Use the navigate action:

    <property as="xs:string" name="oxf.fr.detail.process.send-to-myservice.*.*">
        save
        then send(uri="http://localhost:8080/myservice")
        then success-message(message="Save Successful")
        then navigate(uri="javascript:myFunction()")
        recover error-message(message="Save Failed")
    </property>
    <property as="xs:string" name="oxf.fr.resource.*.*.en.buttons.send-to-myservice" value="Save"/>