I tried my solution in this forum for five days and found some similar situations, but still could not solve my problem.
1- I am using pure jsf
2- I need before deleting a row from my table, there is a confirmation, a modal (I'm trying to use the smartNotifications)
3 - I can call the javascript function and suspend the delete action, but after clicking the button "Yes, I want to delete the record" does not continue the process of erasing the record, stands in the same place.
Follow my example below
Java code
<h:form id="form1">
<h:datatable id="tab1">
<h:column id="column1">
<f:facet name="header">User</f:facet>
<h:outputText rendered="#{bean.User}"></h:outputText>
</h:column>
<h:column id="column2">
<h:commandlink onclick="delete();" action="#{bean.deleteUser}" />
</h:column>
</h:datatable>
</h:form>
Javascript:
function delete(e) {
$.SmartMessageBox({
title: "Are you Sure?",
content: "This action can not be undone",
buttons: '[Yes][No]'
}, function (ButtonPressed) {
if (ButtonPressed === "Yes") {
return true;
}
if (ButtonPressed === "No") {
return false;
}
});
e.preventDefault();
}
Please help me