我需要在用户选择组合框后显示一个ext lib对话框(我使用BootStrap的Select2 for XPages)。 警报代码功能 效果很好,但 XSP.openDialog 没有。 我找到了旧的stackoverflow question about this,但我不明白如何解决我的问题。有什么想法吗?
Tnx很多
$(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
}
});
} )
}
);
答案 0 :(得分:2)
我找到了一个解决方案 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}");
}
});
} )
}
);