[jboss-user] [JBoss Seam] - Problems with <t:dataList>
francisco.noguera
do-not-reply at jboss.com
Thu Oct 11 10:03:05 EDT 2007
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...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094101#4094101
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094101
More information about the jboss-user
mailing list