Ejemplo n.º 1
0
 @Override
 public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
   if (object == null) {
     return null;
   }
   if (object instanceof Employee) {
     Employee o = (Employee) object;
     return getStringKey(o.getId());
   } else {
     throw new IllegalArgumentException(
         "object "
             + object
             + " is of type "
             + object.getClass().getName()
             + "; expected type: "
             + Employee.class.getName());
   }
 }
Ejemplo n.º 2
0
  public void save(ActionEvent actionEvent) {
    // Persist user

    FacesMessage msg = new FacesMessage("Successful", "Welcome :" + current.getFirstName());
    FacesContext.getCurrentInstance().addMessage(null, msg);
  }