3 Replies Latest reply on Oct 12, 2007 12:02 PM by Francisco Noguera

    Problems with <t:dataList>

    Francisco Noguera Newbie

      this is my source code

      xhtml:
      --------------------
      <t:dataList var="marcador" value="#{EnlazarProveedor.marcadores}" layout="simple" rowCountVar="rowCount"
      rowIndexVar="rowIndex"
      preserveDataModel="false">

      <h6>
      <a href="#{marcador.url}url='javascript:EscribirValor()'" id="resultadoURL">
      <h:outputText value="#{marcador.titulo}"/>

      </h6>

      </t:dataList>
      ----------------------
      java Facade:

      @Stateless
      public class SitiosWebFacade extends ReelFacade implements ISitiosWebFacade {

      public List listarMarcadores() {
      String consulta = "SELECT a FROM Marcador a";
      return getEm().createQuery(consulta).getResultList();
      }

      public Marcador guardarMarcador(Marcador marcador) {

      if (marcador != null) {
      if (marcador.getId() == 0)
      getEm().persist(marcador);
      else
      marcador = getEm().merge(marcador);
      }
      return marcador;
      }
      }

      -------------------------------------------------

      java action:

      public class EnlazarProveedorMarcadoresAction extends SitiosWebBaseAction implements IEnlazarProveedorMarcadoresAction {

      private String cid;
      private String arreglo[ ];
      private String nombre;
      private String parametro2;


      /** Creates a new instance of EnlazarProveedorMarcadoresAction */
      public EnlazarProveedorMarcadoresAction() {

      }


      private void validateCid() {
      cid = Conversation.instance().getId();
      }


      @Destroy @Remove
      public void remove() {

      }

      public void iniciar() {
      log.info("Inicia el componente SEAM {0}",new Date());
      validateCid();
      log.info("CID-INICIO: '#0'",cid);
      listarMarcadores();
      }

      public void listarMarcadores(){
      marcadores = sitiosWebFacade.listarMarcadores();
      Iterator it = marcadores.iterator();
      while(it.hasNext()) {
      Marcador m = (Marcador)it.next();
      System.out.println(m.getTitulo());
      }
      }
      }

      ----------------
      The problem is that the dataList component only return me the first value, but the dataTable return me all the values in my DB table. I don't know which is the mistake, but I really need the help. Thanks for the answers...