2 Replies Latest reply on Nov 26, 2010 7:35 AM by Matias Basilico

    h:selectOneMenu is rendering two selected="selected" items after post

    Matias Basilico Newbie
      Hi all !

      A little background, I'm testing the upgrade from (JBoss 4.2.2 and Java 5) to (JBoss 4.2.3 and Java 6)

      I'm having trouble with the h:selectOneMenu component.
      After a postback and in "some situation" (When I choose one specific value) the component is rendering the following HTML code:


      `

      <label>Type of X</label><select ...> 

              <option value="org.jboss.seam.ui.NoSelectionConverter.noSelectionValue">Please Select...</option>
              <option value="0" selected="selected">Type1</option>

              <option value="1">Type2</option>
              <option value="2">Type3</option>
              <option value="3" selected="selected">Type4</option>
              <option value="4">Type5</option>
      </select>
      `





      The steps where the following:
      1. I select "Type1", do a post and to the server
      2. with debugging, I see that the posted value is Type1,
      3. all the logic search Objects of type1,
      4. then the Page render with the result of searching items of type1 (the result list in html show that)
      5. When the page finish loading in the browser the drop-down combo change from Type1 to Type4 ('cause in alphabetical order it makes sense)


      In JBoss 4.2.2 and Java 5 this situation doesn't happen and the application code is the same (xhtml, JSF beans, Seam Components and persistence).

      The onlye thing that make me think a bit es that JBoss 4.2.3 upgrade the sun-jsf upgraded to v1.2_09-b01 (from v1.2_04_P02), somebody know if the h:selectOneMenu can be affected by this upgrade?.

      I google a lot but I don't found the problem yet...why are two items with selected? How this can happen
      'cause is a selectOneMenu! please help!

      Thanks in advance!!