Display selected data from an html combobox

0

I have a question about html in NetBeans , I have the following values in my combobox :

  • .ZONA : South Zone, North Zone, East Zone, West Zone
  • .Quantity : 1, 2
  • .Banco : BCP, BBVA, INTERBANK, SCOTIABANK

I would like to know how to make it show the following values after having selected the options and having correctly selected the catch code:

  • SCO-123456-070518

Where:

  • SCO = the first 3 letters of the bank
  • 123456 = a random number
  • 070518 = is the current date

Below I show you an image of my page.

Here is my code html :

<h:body >
        <p:growl id="msj" showDetail="true"/>
        <h:form id="frm" >
            <p:panel header="Paso #2"
                style="margin: auto;width:580px ">
                    <h:panelGrid columns="3" 
                                 style="margin: auto">
           
            <div>
            <p:outputLabel style="color: white;font-weight:900" for="cboZona" value="Zona"/>
            <p:selectOneMenu id="cboZona" value="#{empleado.empleado.sexo}">
                <f:selectItem itemLabel="Zona Sur" itemValue="zs"/>
                <f:selectItem itemLabel="Zona Este" itemValue="ze"/>    
                <f:selectItem itemLabel="Zona Norte" itemValue="zn"/>
                <f:selectItem itemLabel="Zona Oeste" itemValue="zo"/>  
            </p:selectOneMenu>
            </div>
            <div>
            <p:outputLabel style="color: white;font-weight:900" for="cboCantidad" value="Cantidad"/>
            <p:selectOneMenu id="cboCantidad" value="#{empleado.empleado.estado}">
                <f:selectItem itemLabel="1" itemValue="uno"/>
                <f:selectItem itemLabel="2" itemValue="dos"/>
            </p:selectOneMenu>
            </div>
                        
             <div>
           <p:outputLabel style="color: white;font-weight:900" for="cboBanco" value="Banco" />
        <p:selectOneListbox id="cboBanco" value="#{selectOneView.option}">
            <f:selectItem itemLabel="BCP" itemValue="BCP" />
            <f:selectItem itemLabel="BBVA" itemValue="BBV" />
            <f:selectItem itemLabel="INTERBANK" itemValue="INT" />
               <f:selectItem itemLabel="SCOTIA BANK" itemValue="SCO" />
           
        </p:selectOneListbox>
            </div>    
                        
            <p:commandButton value="Comprar" actionListener="#{empleado.registrar()}" update=":msj" />

            <p:commandButton value="Mostrar" actionListener="#{empleado.listar()}" update="data" />
        
        </h:panelGrid>

            <div align="center" class="g-recaptcha" data-sitekey="6Ld3aVcUAAAAAEoOVQ31fjjwwOM4z8AehQL8pDEk"></div>  </p:panel>   
            <p:panel header="Listar"
                 style="margin: auto;width:580px ">
            <p:dataTable id="data" value="#{empleado.lstEmpleado}" var="emp">
                <p:column headerText="codigo">
                    <p:outputLabel value="#{emp.id}"/>
                </p:column>
                <p:column headerText="Zona">
                    <p:outputLabel value="#{emp.nombre}"/>
                </p:column>
            </p:dataTable>  
            </p:panel>
        </h:form>          
    </h:body>

Thanks for your time.

    
asked by kevvelas 07.05.2018 в 09:14
source

0 answers