Код: Выделить всё
value="Blacklist"
icon="pi pi-ban"
class="ui-button-danger"
rendered="#{!patientController.current.blacklisted}"
process="@this"
oncomplete="PF('blacklistModal').hide();"
update="@form" action="#{patientController.toggleBlacklistPatient(patientController.current, true)}"
public void toggleBlacklistPatient(Patient patient, boolean blacklist){
if(patient == null || patient.getId() == null){
return;
}
if(blacklist && !patient.isBlacklisted()){
Patient newb= getFacade().find(patient.getId());
newb.setBlacklisted(true);
newb.setBlacklistedAt(new Date());
newb.setBlacklistedBy(sessionController.getLoggedUser());
newb.setReasonForBlacklist(patient.getReasonForBlacklist() != null ? patient.getReasonForBlacklist() + " / " + blacklistComment : blacklistComment);
// getFacade().edit(patient);
getFacade().editAndCommit(newb);
this.current = getFacade().findWithoutCache(newb.getId());
blacklistComment = null;
JsfUtil.addSuccessMessage("Patient is blacklisted.");
/>
Здесь javaee, JSF, Primefaces, Mysql.
Подробнее здесь: https://stackoverflow.com/questions/798 ... ot-updated
Мобильная версия