public abstract class MyDataTable extends DataTable {
public MyDataTable(..., List cols, ....) {
super(..., addDeleteCol(cols), ...);
}
private static List addDeleteCol(MyDataTable dt, List cols) {
ArrayList mycols=new ArrayList(cols.size()+1);
mycols.addAll(cols);
mycols.add(new DeleteCol(dt));
}
protected abstract onDelete(Object o);
private static class DeleteCol extends AbstractCol {
private final MyDataTable dt;
public DeleteCol(MyDataTable dt) {
this.dt=dt;
}
populate(..., IModel rowModel) {
add(new Link("delete-link") { onclick() { dt.onDelete(rowModel.getObject()); }});
}
}
On 10/5/06,
Manuel Alejandro de Brito Fontes <[EMAIL PROTECTED]> wrote:
I am new to wicket. So far i don't have problems creating simple pages.So i see the AjaxFallbackDefaultDataTable example and I like start sing it.Doing basic operations works great, remove rows without problems (as example).After that i think that it can be possible encapsulate the table and no repeat that code again.So, what the problem?I have one page that contains a table (the encapsulated) and a SortableDataProvider for the table. One column in the table contains an AjaxLink.I expect that when a press a column in a row eliminate the content from the table and execute one spring service (declared in the page, no in the table) that delete the record from a database.Anyone can help me to understand how can i do that?PS: The Spring integration works fine and if I write all the code in one page the access to the dao delete the record.In the mailing list I see posted a question about inter-component updates ( http://www.nabble.com/Wicket-way-of-doing-%28inter-%29component-updates--tf2139401.html#a5904185 ) but no clear answer come out.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
