> For the complete documentation index, see [llms.txt](https://avbravo-2.gitbook.io/implementar-plantillas-primefaces-jsf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://avbravo-2.gitbook.io/implementar-plantillas-primefaces-jsf/capitulo-vii-formularios/new.md).

# new

Se invoca desde el list, dar enter al escribir el codigo de bodega![](/files/-Lc1WjYN1IeP5Nxb64zO)

Se habilitan los atributos y el boton Guardar.

![](/files/-Lc1WjYPkEduMlQejayR)

## Codigo new\.xhtml

```
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml"
                xmlns:avbravo="http://xmlns.jcp.org/jsf/composite/avbravo"
                xmlns:jsf="http://xmlns.jcp.org/jsf">
    <ui:define name="head">

    </ui:define>   
    <ui:define name="title">#{msg['titleview.bodega']}</ui:define>

    <ui:define name="viewname">#{msg['titleview.bodega']}</ui:define>


    <ui:define name="content">   
        <f:event listener="#{bodegaController.preRenderView('new')}" type="preRenderView"/>
        <h:form id="form" rendered="#{loginController.loggedIn and applicationMenu.bodega.query}" onkeypress="if (event.keyCode == 13) {
                    return false;
                }">   

            <h:panelGroup id="content" layout="block"> 
                <p:messages id="msgs" autoUpdate="true" closable="true"/>



                <div class="ui-g ui-fluid">
                    <!--<div class="ui-g-12 ui-lg-12">-->
                    <div class="ui-g-12 ui-lg-12">
                        <!-- Left Side -->


                        <div class="card card-w-title">
                            <h1>#{msg['titlelist.bodega']}</h1>

                            <avbravo:panelNew label="#{msg['field.idbodega']}"
                                              value="#{bodegaController.bodega.idbodega}"
                                              isnew="#{bodegaController.isNew()}"
                                              new="#{bodegaController.prepare('new',bodegaController.bodega)}"
                                              rendererList="#{applicationMenu.bodega.list}"
                                              list="#{bodegaController.prepare('golist',bodegaController.bodega)}"

                                              />




                            <p:panelGrid id="panel" rendered="#{bodegaController.writable}" columns="4" columnClasses="ui-grid-col-2,ui-grid-col-4,ui-grid-col-2,ui-grid-col-4" layout="grid" styleClass="ui-panelgrid-blank form-group" style="border:0px none; background-color:transparent;">     

                                <p:outputLabel  value="#{msg['field.direccion']}"/>
                                <avbravo:inputText  id="direccion"  value="#{bodegaController.bodega.direccion}"
                                                    text="#{msg['field.direccion']}" />

                                <p:outputLabel  value="#{msg['field.telefono']}"/>
                                <avbravo:inputText  id="telofono"  value="#{bodegaController.bodega.telefono}"
                                                    text="#{msg['field.telefono']}" />


                                <p:outputLabel  value="#{msg['field.activo']}" />
                                <avbravo:activo beanValue="#{bodegaController.bodega.activo}" rendered="#{bodegaController.writable}" />
                                <f:facet name="footer">
                                    <avbravo:buttonSave rendered="#{bodegaController.writable and applicationMenu.bodega.create}"
                                                        save="#{bodegaController.save()}"  />

                                </f:facet>
                            </p:panelGrid>
                        </div>

                    </div>

                </div>

            </h:panelGroup>
        </h:form>
        <avbravo:accesodenegado renderedcondition="#{!loginController.loggedIn or !applicationMenu.bodega.query}" />
    </ui:define>

</ui:composition>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avbravo-2.gitbook.io/implementar-plantillas-primefaces-jsf/capitulo-vii-formularios/new.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
