4 Replies Latest reply on Nov 17, 2008 6:51 PM by Dmitry Shultz

    Seam 2.1 & Glassfish & selectOneMenu

    Thierry Rietsch Newbie

      I'm fighting with a dropdown list problem :-) I would like to have a simple drow down menu, filled with entities. I found a lot of examples in the internet about this, so there is no doubt that this must work :-) Unfortunately it looks like using this on glassfish isn't as easy as using it on a JBoss application server.

      What I've configured so far:

      <persistence:managed-persistence-context name="em" auto-create="true" persistence-unit-jndi-name="java:comp/env/demo/emf" />
      <ui:jpa-entity-loader entity-manager="#{em}" />

      <transaction:ejb-transaction />

          <persistence-unit name="demoPU">
               <!-- The following two properties are for Glassfish -->
                  <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
                  <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.SunONETransactionManagerLookup"/>
                  <property name="hibernate.hbm2ddl.auto" value="update"/>
                  <property name="hibernate.show_sql" value="true"/>
                  <property name="hibernate.transaction.flush_before_completion" value="true"/>
                  <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>


      xhtml page:
      <h:selectOneMenu value="#{offerPosition.product}">
              <s:selectItems value="#{products}" var="prod" label="#{prod.name}" noSelectionLabel="Please Select..." />
              <s:convertEntity />

      For the seam component I have defined a stateful bean which has a conversation scope. The data collection in the background is a linked list which is annotated with @out(required=false) and has a related factory method which fills the collection with data.

      This all gets deploy over a NetBeans Enterprise Project (EAR which contains an ejb-jar and a war). When I now open the page i don't get an error message but I don't see any drop down control on the site. It's just empty. Did I miss something in the configuration? I am getting crazy about this :-)

      Thanks a lot for your help,