0
votes

I need to show a ext lib Dialog after the user select a combobox (I use a Select2 of BootStrap for XPages). The alert code function work well, but the XSP.openDialog not . I've found a old stackoverflow question about this but I don't understand how can I solve my problem. Any ideas?

Tnx a lot

$(document).ready( 
    function() {
        x$("#{id:comboBox1}").select2().on("change", function(e) {
            XSP.allowSubmit();
            XSP.partialRefreshPost("#{id:divView}",{
            onStart: function () {
                // do something when the partial update is finished
                //alert("start...") -- this WORK
                XSP.openDialog("#{id:dialog1}");  //this doesn't work

            },
            onComplete: function () {
                // do something when the partial update is finished
                //alert("stop...")  -- THIS WORK
                XSP.closeDialog("#{id:dialog1}"); //this doesn't work
            }
            }); 
          } ) 
    }
);
1

1 Answers

2
votes

I've found a solution with XSP.allowSubmit();, magic Sven Hasselbach!:

 $(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...") -- this WORK
                 XSP.allowSubmit();
                XSP.openDialog("#{id:dialog1}");

            },
            onComplete: function () {
                // do something when the partial update is finished
                //alert("stop...")  -- THIS WORK
                 XSP.allowSubmit();
                XSP.closeDialog("#{id:dialog1}");
            }
            }); 
          } ) 
    }
);