# new\.xhtml

Consta de dos paneles el superior que usa los componentes \<a:new>, \<a:newdate> y otros componentes new para validar si no existe y un panel para ingresar datos y guardarlos.

![](https://2578941663-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6ze2c8GK7mFBZX%2F-Lc1WjGeqF4Ig-44ZLgX%2F-Lc1X82oizjwpw0MlEHq%2Fnewpanel.png?generation=1554820670417302\&alt=media)

## Código

```java
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<ui:composition template="/layout/template.xhtml" 
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:b="http://bootsfaces.net/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:e="http://xmlns.jcp.org/jsf/composite/extensions"
                xmlns:a="http://xmlns.jcp.org/jsf/composite/avbravo"> 
    <ui:define name="content">
        <!--<h:outputStylesheet library="bsf" name="css/thumbnails.css"/>-->

        <style>
            .thumbnail { max-width: 100%; }
            img.thumbnail:hover, img.thumbnail:focus {
                border: 1px solid;
                border-color: #428BCA;
            }
        </style>

         <b:form id="form"  prependId="false"  rendered="#{loginController.loggedIn and applicationMenu.marca.create}" onkeypress="if (event.keyCode == 13) {
                    return false;
                }">
            <h:panelGroup id="content" layout="block"> 

                <a:messages id="msg"/>
                <a:new label="#{msg['field.descripcion']}"
                       title="#{msg['titleview.marca']}"
                       value="#{marcaController.marca.descripcion}"
                      disabled="#{marcaController.writable}"
                       isnew="#{marcaController.isNew()}"
                       new="#{marcaController.prepare('new',marcaController.marca)}"
                       rendererList="#{applicationMenu.marca.list}"
                       list="#{marcaController.prepare('golist',marcaController.marca)}"

                       />
                <b:panel title="#{app['title.data']}" look="primary" rendered="#{marcaController.writable}">



                    <b:panelGrid id="panel" colSpans="2,10" size="xs" rendered="#{marcaController.writable}"> 

                              <p:outputLabel value="#{msg['field.proveedor']}"/>
                        <e:autocompleteproveedor listener="#{marcaController.handleSelect}"
                                                 value="#{marcaController.marca.proveedor}"
                                                 itemLabel=" #{p.codigo}"
                                                 size="50"
                                                 required="true"
                                                 multiple="true"
                                                 field="codigo"
                                                 update=" :form:content"/>



                        <p:outputLabel  value="#{msg['field.activo']}" />
                        <a:yesno value="#{marcaController.marca.activo}" id="activo"  required="true"/>


                        <a:save rendered="#{marcaController.writable and applicationMenu.marca.create}"
                                      save="#{marcaController.save()}" />


                    </b:panelGrid>


                </b:panel>
            </h:panelGroup>
        </b:form>
        <a:denegado renderedcondition="#{!loginController.loggedIn or !applicationMenu.marca.create}" />

        <br/><br/><br/>
    </ui:define>
</ui:composition>
```
