In XForms, with Orbeon, how to update an XML instance through jQuery?

TienDung

New Member
I want to perform some logic in JavaScript when users click on the span element and update current XML instance from jQuery:(I have seen 2 similar questions online but they never got answered!)XForms:\[code\]<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>\[/code\]JavaScript:\[code\]$('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);});\[/code\]I can see Orbeon posting data (Firebug), but the XML Instance does not get updated (input does not update the output - even though they share same "ref" attribute).
 
Back
Top