Please ignore my stupidity. I misinterpreted the error message I was getting that had nothing to do
with this.
You can still add a delete column to your model with model.add("delete", null) and add a
"deleteCell" parameter to your template in order to have a delete column. Works like a charm.
Uli
Ulrich Stärk schrieb:
Woah! Indeed, this doesn't work anymore. Evil. How are we supposed to do
this now?
Uli
Geoff Callender schrieb:
No response, so I guess that means we can't add a Delete column to a
Grid any more.
On 14/10/2008, at 8:36 PM, Geoff Callender wrote:
Can anyone tell me if Penyihir's technique for adding a Delete column
to Grid still works?
Please note this is not the same as editing a flag in the source
entity - this is different - it's editing a column that we've added
to the model.
On 10/12/2007, at 7:08 PM, Penyihir Kecil wrote:
it might be help :
-------------------
GridClub.tml
------------------
<form t:type="Form" t:id="clubForm">
<table t:type="grid" rowsPerPage="5" pagerPosition="top"
source="clubList" row="club" remove="idClub" model="clubModel">
<t:parameter name="deleteCell">
<input t:type="Checkbox" t:id="delete" value="delete"/>
</t:parameter>
<t:parameter name="updateCell">
<a t:type="PageLink" t:id="update" page="admin/FormClub"
context="club.idClub"><img src="../images/edit.gif"/></a>
</t:parameter>
<!-- <t:parameter name="deleteCell">
<a t:type="ActionLink" t:id="delete"
context="club.idClub">delete</a>
</t:parameter>-->
</table>
<input type="submit" value="delete"/>
---------------------
GridClub.java
---------------------
@Inject
private IClubDao clubDao;
private List<Club> clubList;
private Club club; @Retain
private BeanModel clubModel;
@Inject
private BeanModelSource beanModelSource;
@Inject
private ComponentResources resources;
private boolean delete;
public List<String> deletedList;
public boolean isDelete() {
return delete;
}
public void setDelete(boolean delete) {
if(delete){
getDeletedList().add(club.getIdClub());
}
}
public List<String> getDeletedList() {
if(deletedList == null){
deletedList = new ArrayList<String>();
}
return deletedList;
}
void pageLoaded(){
clubModel = beanModelSource.create(Club.class, true, resources);
clubModel.add("delete",null);
clubModel.add("update",null);
}
public Club getClub() {
return club;
}
public void setClub(Club club) {
this.club = club;
}
public IClubDao getClubDao() {
return clubDao;
}
public List<Club> getClubList() {
if(clubList == null){
clubList = new ArrayList<Club>(); clubList
= getClubDao().queryForList("", "");
}
return clubList;
}
public BeanModel getClubModel() {
return clubModel;
}
Object onSuccessFromClubForm(){
for (Iterator<String> iter = getDeletedList().iterator();
iter.hasNext();) {
String element = iter.next();
setClub((Club) getClubDao().findByPrimaryKey(element));
getClubDao().delete(getClub());
} deletedList =
null;
return GridClub.class;
}
On 12/10/07, Cristian Gonzalo Gary <[EMAIL PROTECTED]> wrote:
Hello
I need to modified the Column label, and put into and image with a
link .
Thanks.
Gracias.
--
View this message in context:
http://www.nabble.com/-T5--How-Add-and-Image-to-Grid-Column-Label.-tp14242580p14242580.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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]