use of org.entirej.framework.core.enumerations.EJQuestionButton in project rap by entirej.
the class EJRWTTreeRecordBlockRenderer method askToDeleteRecord.
@Override
public void askToDeleteRecord(final EJDataRecord recordToDelete, String msg) {
if (msg == null) {
msg = "Are you sure you want to delete the current record?";
}
EJMessage message = new EJMessage(msg);
EJQuestion question = new EJQuestion(new EJForm(_block.getForm()), "DELETE_RECORD", "Delete", message, "Yes", "No") {
@Override
public void setAnswer(EJQuestionButton answerButton) {
super.setAnswer(answerButton);
if (EJQuestionButton.ONE == answerButton) {
_block.getBlock().deleteRecord(recordToDelete);
}
_block.setRendererFocus(true);
}
};
_block.getForm().getMessenger().askQuestion(question);
}
Aggregations