Search in sources :

Example 6 with EJQuestion

use of org.entirej.framework.core.data.controllers.EJQuestion in project rap by entirej.

the class EJRWTListRecordBlockRenderer method askToDeleteRecord.

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);
}
Also used : EJQuestionButton(org.entirej.framework.core.enumerations.EJQuestionButton) EJQuestion(org.entirej.framework.core.data.controllers.EJQuestion) EJForm(org.entirej.framework.core.EJForm) EJMessage(org.entirej.framework.core.EJMessage)

Example 7 with EJQuestion

use of org.entirej.framework.core.data.controllers.EJQuestion in project rap by entirej.

the class EJRWTLineChartRecordBlockRenderer 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);
}
Also used : EJQuestionButton(org.entirej.framework.core.enumerations.EJQuestionButton) EJQuestion(org.entirej.framework.core.data.controllers.EJQuestion) EJForm(org.entirej.framework.core.EJForm) EJMessage(org.entirej.framework.core.EJMessage)

Example 8 with EJQuestion

use of org.entirej.framework.core.data.controllers.EJQuestion in project rap by entirej.

the class EJRWTSingleRecordBlockRenderer 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);
}
Also used : EJQuestionButton(org.entirej.framework.core.enumerations.EJQuestionButton) EJQuestion(org.entirej.framework.core.data.controllers.EJQuestion) EJForm(org.entirej.framework.core.EJForm) EJMessage(org.entirej.framework.core.EJMessage)

Example 9 with EJQuestion

use of org.entirej.framework.core.data.controllers.EJQuestion 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);
}
Also used : EJQuestionButton(org.entirej.framework.core.enumerations.EJQuestionButton) EJQuestion(org.entirej.framework.core.data.controllers.EJQuestion) EJForm(org.entirej.framework.core.EJForm) EJMessage(org.entirej.framework.core.EJMessage)

Aggregations

EJForm (org.entirej.framework.core.EJForm)9 EJMessage (org.entirej.framework.core.EJMessage)9 EJQuestion (org.entirej.framework.core.data.controllers.EJQuestion)9 EJQuestionButton (org.entirej.framework.core.enumerations.EJQuestionButton)9