/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entites;


import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.NoneScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

@ManagedBean(name="ac")
@NoneScoped
public class Knoeppke {

  public String listen() {
    FacesContext fc = FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage("wer wars?"));
    return "./index.xhtml";
  }

  public void listen(ActionEvent e) {
    UIComponent u= e.getComponent();
    FacesContext fc = FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage("es war "+u.getId()));
  }
}
