9 Replies Latest reply on Oct 3, 2008 11:06 PM by pmuir

    s:selectItems + s:convertEntity not pre-selecting

    monkeyden

      Using 2.0.3.CR1 on AS 4.2


      I'm using the following snippet of code to render a selectOneListbox:


      <h:selectOneListbox value="#{donationManager.editableDonation.donor}" size="1">
           <s:selectItems value="#{donors}" var="donor" label="#{donor.name}" noSelectionLabel="Please select a donor..."/>
           <s:convertEntity/>
           <a4j:support ajaxSingle="true" event="onchange"/>
      </h:selectOneListbox>



      editableDonation is the selected donation.  donors is an application scoped list of Donors.  Every donation must have a donor.  I also have the entity converter configured in components.xml like so:


      <component name="org.jboss.seam.ui.EntityConverter">
          <property name="entityManager">#{em}</property>
      </component>



      The problem is, it doesn't pre-select the donor and when I submit, it doesn't convert the entity and call the mutator on editableDonation.  One interesting behavior I noticed on the client is that it simply prints the index value for the select tag, when I would expect it to use the value @Id from the entity.


      Any suggestions are appreciated.