Monday, February 17, 2014

PAGINA CON 4 SelectOneMenu

PAGINA CON 4 SelectOneMenu
En este ejemplo mostraremos el uso de selectOneMenu, en el cual se actualizaran dependiente de la selección que se realice

    <h:outputLabel value="#{msg.idnivel1}" for="idnivel1" />
                               <p:selectOneMenu converter="nivel1Converter" id="idnivel1"
                                                value="#{nivel2SearchController.nivel2.idnivel1}"                                                 
                                                filter="true" filterMatchMode="startsWith" effect="fade"
                                                >
                                   <!-- TODO: update below reference to list of available items-->
                                   <f:selectItem itemLabel="#{app['selectonemenu.select']}" itemValue="#{null}"/>  
                                   <f:selectItems value="#{nivel1SearchController.items}"
                                                  var="item"
                                                  itemValue="#{item}"
                                                  itemLabel="#{item.idnivel1} - #{item.nombre}"                                                    
                                                  />
                                   <p:ajax  process="idnivel1"  event="change"
                                            update=":form:idnivel2,:form:growl"
                                            listener="#{nivel2SearchController.changeItems()}"/>                                     
                               </p:selectOneMenu>
                               
                               <h:outputLabel value="#{msg.idnivel2}" for="idnivel2" />
                               <p:selectOneMenu converter="nivel2Converter" id="idnivel2"
                                                value="#{nivel3SearchController.nivel3.idnivel2}"  
                                                required="true" requiredMessage="#{msg.idnivel2} #{app['info.required']}"
                                                filter="true" filterMatchMode="startsWith" effect="fade"
                                                >
                                   <!-- TODO: update below reference to list of available items-->
                                    <f:selectItem itemLabel="#{app['selectonemenu.select']}" itemValue="#{null}"/>  
                                   <f:selectItems value="#{nivel2SearchController.itemsEntity}"
                                                  var="item"
                                                  itemValue="#{item}"
                                                  itemLabel="#{item.idnivel2} -  #{item.nombre}"
                                                  />
                                      <p:ajax  process="idnivel2"  event="change"
                                            update=":form:idnivel3,:form:growl"
                                            listener="#{nivel3SearchController.changeItems()}"/>        
                               </p:selectOneMenu>
                               
                                <h:outputLabel value="#{msg.idnivel3}" for="idnivel3" />
                               <p:selectOneMenu converter="nivel3Converter" id="idnivel3"
                                                value="#{nivel4SearchController.nivel4.idnivel3}"  
                                                required="true" requiredMessage="#{msg.idnivel3} #{app['info.required']}"
                                                filter="true" filterMatchMode="startsWith" effect="fade"
                                                >
                                   <!-- TODO: update below reference to list of available items-->
                                     <f:selectItem itemLabel="#{app['selectonemenu.select']}" itemValue="#{null}"/>
                                   <f:selectItems value="#{nivel3SearchController.itemsEntity}"
                                                  var="item"
                                                  itemValue="#{item}"
                                                  itemLabel="#{item.idnivel3} -  #{item.nombre}"
                                                  />
                                             <p:ajax  process="idnivel3"  event="change"
                                            update=":form:idnivel4,:form:growl"
                                            listener="#{nivel4SearchController.changeItems()}"/>     
                               </p:selectOneMenu>
                               
                                
                                    <h:outputLabel value="#{msg.idnivel4}" for="idnivel4" />
                               <p:selectOneMenu converter="nivel4Converter" id="idnivel4"
                                                value="#{nivel5Controller.nivel5.idnivel4}"  
                                                required="true" requiredMessage="#{msg.idnivel4} #{app['info.required']}"
                                                filter="true" filterMatchMode="startsWith" effect="fade"
                                                >
                                   <!-- TODO: update below reference to list of available items-->
                                   
                                   <f:selectItems value="#{nivel4SearchController.itemsEntity}"
                                                  var="item"
                                                  itemValue="#{item}"
                                                  itemLabel="#{item.idnivel4} -  #{item.nombre}"
                                                  />
                                         
                               </p:selectOneMenu>

                                


No comments: