2 Replies Latest reply on Nov 30, 2009 5:55 PM by Wagner Santos

    Yet another problem with h:selectOneMenu sequencial values

    Wagner Santos Newbie

      Hello,
      I have a h:selectOneMenu with s:selectItems and s:convertEntity, but I don't know why the option value is sequencial not the entity ID. See the code of xhtml:
              <s:decorate template="/layout/display.xhtml">
                      <ui:define name="label">Escritório</ui:define>
                      <h:selectOneMenu id="escritorioExterno" value="#{projetoList.projeto.escritorioExterno}">
                               <s:selectItems value="#{escritorioExternoList.resultList}" var="escritorios" label="#{escritorios.nome}"
                                      itemValue="#{escritorios}" hideNoSelectionLabel="true" noSelectionLabel="Selecione..."/>
                            <s:convertEntity />
                          </h:selectOneMenu>
                  </s:decorate>
                 
                  <s:decorate template="/layout/display.xhtml">
                      <ui:define name="label">Tipo</ui:define>
                      <h:selectOneMenu id="tipoProcessual" value="#{projetoList.projeto.idTipoProcessual}">
                               <s:selectItems value="#{tipoProcessualList.resultList}" var="tipoProcessual" label="#{tipoProcessual.descricao}"
                                      itemValue="#{tipoProcessual}" hideNoSelectionLabel="true" noSelectionLabel="Selecione..."/>
                            <s:convertEntity />
                          </h:selectOneMenu>
                  </s:decorate>


      And generated HTML:
      <div id="projetoPesquisar:j_id91">

          <div class="prop">
              <span class="name">Escrit&oacute;rio
              </span>
              <span class="value"><select id="projetoPesquisar:j_id91:escritorioExterno" name="projetoPesquisar:j_id91:escritorioExterno" size="1">     <option value="org.jboss.seam.ui.NoSelectionConverter.noSelectionValue">Selecione...</option>
           <option value="79">Veneza Advocacia</option>
           <option value="80">ACJ Adv</option>
      </select>
              </span>
          </div></div><div id="projetoPesquisar:j_id97">

          <div class="prop">
              <span class="name">Tipo
              </span>
              <span class="value"><select id="projetoPesquisar:j_id97:escritorioExterno" name="projetoPesquisar:j_id97:escritorioExterno" size="1">     <option value="org.jboss.seam.ui.NoSelectionConverter.noSelectionValue">Selecione...</option>
           <option value="81">CONHECIMENTO</option>
           <option value="82">EXECU&Ccedil;&Atilde;O</option>
           <option value="83">EMBARGOS</option>
           <option value="84">EXECU&Ccedil;&Atilde;O AOS EMBARGOS</option>
           <option value="85">RECURSO</option>
           <option value="86">INCIDENTE PROCESSUAL</option>
      </select>
              </span>
          </div></div>

      I don't understand this. In other pages I don't have any trouble. I'm using Seam Application Framework in my app.
      I appreciate any help.

        • 1. Re: Yet another problem with h:selectOneMenu sequencial values
          Wagner Santos Newbie

          Sorry! Formating the code:


                  <s:decorate template="/layout/display.xhtml">
                          <ui:define name="label">Escritório</ui:define>
                          <h:selectOneMenu id="escritorioExterno" value="#{projetoList.projeto.escritorioExterno}">
                                   <s:selectItems value="#{escritorioExternoList.resultList}" var="escritorios" label="#{escritorios.nome}" 
                                          itemValue="#{escritorios}" hideNoSelectionLabel="true" noSelectionLabel="Selecione..."/>
                                <s:convertEntity />
                              </h:selectOneMenu>
                      </s:decorate>
                      
                      <s:decorate template="/layout/display.xhtml">
                          <ui:define name="label">Tipo</ui:define>
                          <h:selectOneMenu id="tipoProcessual" value="#{projetoList.projeto.idTipoProcessual}">
                                   <s:selectItems value="#{tipoProcessualList.resultList}" var="tipoProcessual" label="#{tipoProcessual.descricao}" 
                                          itemValue="#{tipoProcessual}" hideNoSelectionLabel="true" noSelectionLabel="Selecione..."/>
                                <s:convertEntity />
                              </h:selectOneMenu>
                      </s:decorate>





          <div id="projetoPesquisar:j_id91"> 
           
              <div class="prop"> 
                  <span class="name">Escrit&oacute;rio
                  </span> 
                  <span class="value"><select id="projetoPesquisar:j_id91:escritorioExterno" name="projetoPesquisar:j_id91:escritorioExterno" size="1">     <option value="org.jboss.seam.ui.NoSelectionConverter.noSelectionValue">Selecione...</option> 
               <option value="79">Veneza Advocacia</option> 
               <option value="80">ACJ Adv</option> 
          </select> 
                  </span> 
              </div></div><div id="projetoPesquisar:j_id97"> 
           
              <div class="prop"> 
                  <span class="name">Tipo
                  </span> 
                  <span class="value"><select id="projetoPesquisar:j_id97:escritorioExterno" name="projetoPesquisar:j_id97:escritorioExterno" size="1">     <option value="org.jboss.seam.ui.NoSelectionConverter.noSelectionValue">Selecione...</option> 
               <option value="81">CONHECIMENTO</option> 
               <option value="82">EXECU&Ccedil;&Atilde;O</option> 
               <option value="83">EMBARGOS</option> 
               <option value="84">EXECU&Ccedil;&Atilde;O AOS EMBARGOS</option> 
               <option value="85">RECURSO</option> 
               <option value="86">INCIDENTE PROCESSUAL</option> 
          </select> 
                  </span> 
              </div></div>



          • 2. Re: Yet another problem with h:selectOneMenu sequencial values
            Wagner Santos Newbie

            Can anyone help me? I have no idea why this is happening.