sorry for being not so clear in my previous explanation,here the complete
code concerning my problem:
I need to show a list of products, and because each product can contain one
or more contents, I want to add a list of actionlink in the last column
representing the content list related.
@Entity
public class Product implements java.io.Serializable{
private long idProd;
private ProdType prodType;
private String idServiceType;
private String status;
private Date reqDate;
private String dex;
private Collection<Content> contents = new ArrayList<Content>();
@Id
@GeneratedValue
public long getIdProd(){return idProd;}
public void setIdProd(long idProd){this.idProd=idProd;}
@ManyToOne
public ProdType getProdType(){return prodType;}
public void setProdType(ProdType prodType){this.prodType=prodType;}
public String getIdServiceType() {return idServiceType;}
public void setIdServiceType(String idServiceType) {this.idServiceType =
idServiceType;}
public String getStatus(){
....
}
public void setStatus(String status){this.status=status;}
@Temporal(TemporalType.DATE)
public Date getReqDate(){return reqDate;}
public void setReqDate(Date reqDate){this.reqDate=reqDate;}
public String getDex(){return dex;}
public void setDex(String dex){this.dex=dex;}
@OneToMany(cascade={CascadeType.ALL})
public Collection<Content> getContents(){return contents;}
public void setContents(Collection<Content>
contents){this.contents=contents;}
@Override
public int hashCode() {
...
}
@Override
public boolean equals(Object obj) {
...
}
}
@Entity
public class Content implements java.io.Serializable {
private long idCont;
private Operator operator;
private String host;
private String folder;
private String fileName;
@Id
@GeneratedValue
public long getIdCont(){return idCont;}
public void setIdCont(long idCont){this.idCont=idCont; }
other setter/getter methods
}
public class ProductMonitor{
@ApplicationState
private DuckBeanRemote dao;
@ApplicationState
private Coordinator coordinator;
@Persist
private Product product;
public Product getProduct() {return product;}
public void setProduct(Product product) {this.product = product;}
public DuckBeanRemote getDao() {return dao;}
public void setDao(DuckBeanRemote dao) {this.dao = dao;}
public Coordinator getCoordinator() {return coordinator;}
public void setCoordinator(Coordinator coordinator) {this.coordinator =
coordinator;}
public Collection<Product> getProducts(){return dao.getProducts();}
public Object onActionFromSend(long
idProd){dao.sendProduct(idProd);return
this;}
public Object onActionFromLogout(String
username){coordinator=null;return
Index.class;}
}
ProductMonitor.tml
<t:grid t:source="products" rowsPerPage="5" row="product" add="send,
????">
<t:parameter name="sendCell">
<t:actionlink t:id="send"
t:context="product.idProd">send</t:actionlink>
</t:parameter>
<t:parameter name="sendCell">
????I need to show here the list of contents of
the current product
(idprod)
</t:parameter>
</t:grid>
--
View this message in context:
http://www.nabble.com/manage-sub-collection-with-grid-component-tp19954739p19964387.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]