Re: manage sub-collection with grid component

2008-10-13 Thread mdes

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 contents = new ArrayList();

@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 getContents(){return contents;}
public void setContents(Collection
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 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



send


I need to show here the list of contents of 
the current product
(idprod) 




   
-- 
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]



Re: manage sub-collection with grid component

2008-10-13 Thread Hugo Palma
Have you taken a look at the "Adding Columns Example" here 
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html 
?


Does that solve your problem ?

mdes wrote:
Dear all, 
I need your support in order to determine the better way to solve this

situation.

I have, say, 2 entities (ejb3)

@Entity
public class Child {
private String idChild;
private String firstName;
private String secondName;
...
}

@Entity
public class Father{
private String idFather;


private Collection children;
...
}

And I want to build a table in this way:
- for each row, print all Father properties
- in the last column, I want to insert a list of links to the each child
related to the specific Father in the row. 


I'm working on a grid component, so:



but what can I insert in the "childrenInfo" column?
I think that one solution could be a new component that accepts the idFather
as parameter, and then returns the html code for the Children list. Is this
a good idea?

Any suggestions/thoughts?









  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



manage sub-collection with grid component

2008-10-13 Thread mdes

Dear all, 
I need your support in order to determine the better way to solve this
situation.

I have, say, 2 entities (ejb3)

@Entity
public class Child {
private String idChild;
private String firstName;
private String secondName;
...
}

@Entity
public class Father{
private String idFather;


private Collection children;
...
}

And I want to build a table in this way:
- for each row, print all Father properties
- in the last column, I want to insert a list of links to the each child
related to the specific Father in the row. 

I'm working on a grid component, so:



but what can I insert in the "childrenInfo" column?
I think that one solution could be a new component that accepts the idFather
as parameter, and then returns the html code for the Children list. Is this
a good idea?

Any suggestions/thoughts?









-- 
View this message in context: 
http://www.nabble.com/manage-sub-collection-with-grid-component-tp19954739p19954739.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]