I'm trying to create an Orbeon Forms XBL wrapper around a javascript media player control for inclusion in an XForms application.
The URL of the media file must be constructed dynamically based on a value of another control (e.g xforms:input) also associated with the same data instance. Therefore the component interface will be of the form:
<comp:player ref="instance('data')/name"/>
and elsewhere on the page there will be another control referencing the same value e.g.
<xforms:input ref="instance('data')/name"/>
where the value of the referenced instance data will contain the name of a file which is then appended to a base URL within the XBL component to make the final URL of the media file.
The problem I'm having is knowing how to access this value from javascript within the XBL component. I can incorporate a script that is invoked when the referenced data instance value changes, but I just can't see how you can then access the value from javascript so that I can create the URL and pass it to the media control.
<xxforms:script ev:event="xforms-value-changed" type="text/javascript">
/* How do you access the components referenced value? */
var controlValue = ORBEON.xforms.Document.getValue(??????????);
/* construct the url of the media file from this value. */
media.player.load('baseurl/' + controlValue);
</xxforms:script>
Can anybody suggest an appropriate way to solve this sort of problem in an Xforms XBL component?