@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()); } }
public void save(ActionEvent actionEvent) { // Persist user FacesMessage msg = new FacesMessage("Successful", "Welcome :" + current.getFirstName()); FacesContext.getCurrentInstance().addMessage(null, msg); }