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

Prepare

Se utiliza para las operaciones

  • new,

  • search

  • writable,

  • edit.

// <editor-fold defaultstate="collapsed" desc="prepare(String action, Object... item)">
    @Override
    public String prepare(String action, Object... item) {
        String url = "";
        try {
            switch (action) {
                case "new":
                    bodega = new Bodega();
                    bodegaSelected = new Bodega();

                    writable = false;
                    break;

                case "edit":
                    if (item.length != 0) {
                        bodegaSelected = (Bodega) item[0];
                        bodega = bodegaSelected;
                        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("pagebodega", page.toString());
                    }

                    url = "/pages/bodega/view.xhtml";
                    break;
                case "golist":
                    url = "/pages/bodega/list.xhtml";
                    break;

                case "gonew":
                    url = "/pages/bodega/new.xhtml";
                    break;
            }

        } catch (Exception e) {
            JsfUtil.errorMessage("prepare() " + e.getLocalizedMessage());
        }

        return url;
    }// </editor-fold>
PreviousResetNextShowAll

Last updated 6 years ago

Was this helpful?