Plantillas Primefaces JSF
  • Introduction
  • Proyecto JEE
    • Introduccion
    • POSEIDON
    • Descomprimir template
    • Proyecto JEE
    • Dependencias
    • Sources
    • Ejecutar proyecto
    • TEMPLATE RESPONSIVE
    • Plantilla Bootfaces
      • Introduction
      • Plantilla
        • Clonar Template
        • Proyecto EJB
        • Proyecto Web
        • template base
        • top
        • footer.xhtml
        • Properties
        • Roles
        • Util
        • template base
        • page
  • Capitulo II. Crear EJB
    • MongoDB
    • Proyecto EJB
    • Dependencias
    • Paquetes
    • Provider
    • Entity
    • Repository
    • Converter
    • Services
    • Datamodel
  • Capitulo III. Configuracion
    • Paquetes
    • Util
    • Properties
    • Template
    • Footer
    • Logo
    • Componentes
  • Capitulo IV. Login
    • Dependencias ejb
    • Roles
    • ApplicationMenu
    • RolAdministrador
    • ValidadorRoles
    • LoginController
    • Login.xhtml
  • Capitulo V. Menu
    • Menu
  • Capitulo VI Controller
    • Controller Simple
    • Implementar IController
    • Colapsar Codigo
    • Atributos
    • GetPages
    • Init
    • Reset
    • Prepare
    • ShowAll
    • IsNew
    • Save
    • Edit
    • Delete
    • Print
    • handleSelected
    • Paginacion
    • Codigo Completo
  • Capitulo VII Formularios
    • Carpetas
    • list.xhtml
    • new
    • view
  • Capitulo X Referenciados y Embebidos
    • Referenciados
  • Plantilla Bootfaces
    • Untitled
Powered by GitBook
On this page

Was this helpful?

  1. Capitulo VI Controller

Save

public String save()

 @Override
    public String save() {
        try {
            Optional<Bodega> optional = bodegaFacade.findById(bodega);
            if (optional.isPresent()) {
                JsfUtil.warningDialog(rf.getAppMessage("info.message"), rf.getAppMessage("warning.idexist"));
                return null;
            }

            //Lo datos del usuario
            bodega.setUserInfo(userInfoServices.generateListUserinfo(loginController.getUsername(), "create"));
            if (bodegaFacade.save(bodega)) {
                JsfUtil.successMessage(rf.getAppMessage("info.save"));
                reset();
            } else {
                JsfUtil.successMessage("save() " + bodegaFacade.getException().toString());
            }

        } catch (Exception e) {
            JsfUtil.errorMessage("save()" + e.getLocalizedMessage());
        }
        return "";
    }
PreviousIsNewNextEdit

Last updated 6 years ago

Was this helpful?