1
votes

Hello I have a problem with Select2 component because this code that capture onChange event:

$(document).ready( 
function() {
    x$("#{id:comboBox1}").select2().on("change", function(e) {
            XSP.partialRefreshPost("#{id:divView}",{
        onStart: function () {
            // do something when the partial update is finished
            alert("start...") 

        },
        onComplete: function () {
            // do something when the partial update is finished
            alert("stop...")  
        }
        }); 
      } ) 
}
);

Generate in Google Chrome this error that doesn't resolve x$() function (If you reload the page work) In Internet Explorer work well..I don't know how solve.

Uncaught TypeError: undefined is not a function home.xsp:129x$ home.xsp:129j jquery-1.11.0.min.js:2k.fireWith jquery-1.11.0.min.js:2n.extend.ready jquery-1.11.0.min.js:2K jquery-1.11.0.min.js:2

Have someone any suggest?

Tnx you

1

1 Answers

0
votes

Try using XSP.addOnLoad() instead of $(document).ready() in order for your function to run when the document has been fully loaded by XPages.