private void performDestroy() {
   try {
     getFacade().remove(current);
     JsfUtil.addSuccessMessage(
         ResourceBundle.getBundle("/Bundle").getString("EspecialidadeDeleted"));
   } catch (Exception e) {
     JsfUtil.addErrorMessage(
         e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
   }
 }
 public String create() {
   try {
     getFacade().create(current);
     JsfUtil.addSuccessMessage(
         ResourceBundle.getBundle("/Bundle").getString("EspecialidadeCreated"));
     return prepareCreate();
   } catch (Exception e) {
     JsfUtil.addErrorMessage(
         e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
     return null;
   }
 }
 public SelectItem[] getItemsAvailableSelectOne() {
   return JsfUtil.getSelectItems(ejbFacade.findAll(), true);
 }
 public SelectItem[] getItemsAvailableSelectMany() {
   return JsfUtil.getSelectItems(ejbFacade.findAll(), false);
 }
Ejemplo n.º 5
0
 public static Object getObjectFromRequestParameter(
     String requestParameterName, Converter converter, UIComponent component) {
   String theId = JsfUtil.getRequestParameter(requestParameterName);
   return converter.getAsObject(FacesContext.getCurrentInstance(), component, theId);
 }