deletete.java

来自「一个虚拟训练系统.主要使用j2ee框架实现.」· Java 代码 · 共 38 行

JAVA
38
字号
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 + =
减小字号Ctrl + -
显示快捷键?