<script>
//connect to the web socket when the page is ready.
$( document ).ready(function() {
b4j_connect("/ws");
// The confirm dialog. Ensure the selector and the b4j raise events naming are exactly matching in the B4J code
$( "#confirmdialog" ).dialog({
resizable: false,
height:180,
modal: true,
autoOpen: false,
buttons: {
"Ja": function()
{
b4j_raiseEvent("confirmdialog_event", {"result": "yes"});
$( this ).dialog( "close" );
},
"Nee": function()
{
b4j_raiseEvent("confirmdialog_event", {"result": "no"});
$( this ).dialog( "close" );
}
}
});
$( "#alertdialog" ).dialog({
resizable: false,
modal: true,
height:150,
width: 180,
autoOpen: false,
buttons: {
"Close": function()
{
b4j_raiseEvent("alertdialog_event", {"result": "close"});
$( this ).dialog( "close" );
}
}
});
});
</script>