XForms Orbeon does not update current XML Instance through JQuery

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

XForms Orbeon does not update current XML Instance through JQuery

AdamNapora
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.
Reply | Threaded
Open this post in threaded view
|

Re: XForms Orbeon does not update current XML Instance through JQuery

AdamNapora
Issue solved, calculations in the model where auto-update-ing my input element, issue resolved