4 Replies Latest reply on Mar 13, 2007 8:19 AM by cavani

    EntityConverter

    pmuir

      I've added the EntityConverter from the wiki to CVS (with significant refactoring). Now, all you should need to do is:

      <h:selectOneMenu value="#{person.continent}">
       <s:selectItems value="#{continents.resultList}" var="continent" label="#{continent.name}" />
       <s:convertEntity />
      </h:selectOneMenu>


      for any dropdown which uses entities. It would be great if y'all could test this :)

      The upshot of the refactoring is that it now works ootb for select manys and composite (embedded) ids. The example and reference guide show the use of this control.

        • 1. Re: EntityConverter
          cavani

          I try it, but I could not set more than one MPC, right?

          this will be considered?

          Thanks,

          • 2. Re: EntityConverter
            cavani

            I don't test too much, but it works:

            on project component.xml:

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


            and on JSF page:

            <h:selectOneMenu value="#{ currentContact.category }">
             <s:selectItems value="#{ categoryCombo }" var="category" label="#{ category }"/>
             <f:converter converterId="myEntityConverter"/>
            </h:selectOneMenu>
            


            this is a right use of this util?

            • 3. Re: EntityConverter
              pmuir

              Yup :) That was what I was thinking of :)

              • 4. Re: EntityConverter
                cavani

                Great!

                It work nice to me: 4 MPC, each one with a converter.

                Thanks!