2 Replies Latest reply on Apr 19, 2008 10:56 AM by tomas kral

    selectItems

    tomas kral Newbie

      Hi,
      I am quite confused about seam selectItems. Can anybody help me to clarify it.
      There are several possibilities, how to use it:


      1.(built in seam jar)
      s:selectItems and s:convertEntity


      2.new design (separate jars - selectitems-1.1.1beta4.zip):
      si:selectItems with BasicEntityConverter
      http://wiki.jboss.org/wiki/SeamSelectItemsNewDesign


      3.(separate jar - entityconverter-0.1.zip)
      s:selectItems and ec:convertEntity http://wiki.jboss.org/wiki/SeamEntityConverter


      In which seam version (1.1.x, 1.2.x, 2.x) should be used given possibility used?


      Thanks

        • 1. Re: selectItems
          Richard Ogin Newbie

          Download the Seam package from jboss.com. Unzip it and go into the lib directory. Copy jboss-seam-ui.jar to your project lib directory. Below is an example of how to use it with Facelets.


          <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                          xmlns:s="http://jboss.com/products/seam/taglib"
                          xmlns:ui="http://java.sun.com/jsf/facelets"
                          xmlns:f="http://java.sun.com/jsf/core"
                          xmlns:h="http://java.sun.com/jsf/html"
                          xmlns:rich="http://richfaces.org/rich"
                          xmlns:a4j="http://richfaces.org/a4j">
          
          <h:selectOneMenu value="#{testBean.selectedName}">
            <s:selectItems value="#{testBean.names}" var="name" label="#{name}"/>
          </h:selectOneMenu>
          



          The testBean in this example returns a List<String> but can technically return a collection of anything. If it is something else, you will need to specify an entity converter. Hope that helps. This is all based on me using Seam 2.0.X.GA.

          • 2. Re: selectItems
            tomas kral Newbie

            OK, in version 2.x.x there is no need to include another jar (selectItems.jar for si:selectItems, entityconverter for ec:convertEntity), but what about versions 1.1.6 and earlier and what about 1.2.x)?