📄 deletete.java
字号:
package com.jsfcompref.trainer.backing;
import com.jsfcompref.trainer.TrainingEvent;
import com.jsfcompref.trainer.TrainingEventRegistry;
import com.jsfcompref.trainer.util.JSFUtil;
import javax.faces.application.Application;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
/**
* Backing bean for delete_te.jsp
*/
public class DeleteTe {
public DeleteTe() {
}
public String deleteTEAction() {
FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
//Get TrainingEvent to be delete and store locally as "te"
TrainingEvent te = (TrainingEvent)JSFUtil.getManagedObject("EditTrainingEvent");
// Get TrainingEventRegistry - store in "eventRegistry"
TrainingEventRegistry eventRegistry = (TrainingEventRegistry) JSFUtil.getManagedObject("TrainingEventRegistry");
// Call TE registry method to delete the selected training event.
eventRegistry.deleteTrainingEvent(te);
return "main";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -