|
I have an issue, I want to perform some logic in JS when clicked on the span element and update current XML instance from JQuery:
(seen 2 similar questions on whole internet but they never got answered!)
XForms:
<xhtml:span class="buttonPlusOne" id="plusVat">+</xhtml:span> <xf:output ref="instance('submitted_instance')/TotVATAmnt"></xf:output> <xf:input id="changeVatTotal" ref="instance('submitted_instance')/TotVATAmnt"></xf:input>
JavaScript:
$('span.buttonPlusOne').on('click', function () {
// do some logic and increment value for 0.01
orbeonElId = $(this).siblings('#changeVatTotal').children('input').attr('id');
// alert(orbeonElId) produces right id (changeVatTotal$xforms-input-1)
// alert(newValue) produces 0.02 (for example)
ORBEON.xforms.Document.setValue(orbeonElId, newValue);
});
So, I can see Orbeon posting data (Firebug), but current XML Instance does not get updated (input does not update the output - even though they share same "ref" attr),
Any help GREATLY appreciated.
|