Re: Access, read and modify td Tag (cell tag) in Datatable

2013-01-29 Thread Paul Bors
You were close, this is what I did to support ACC in simple tables:

@Override
protected ItemIColumnT newCellItem(final String id, final int index,
final IModelIColumnT model) {
ItemIColumnT item = super.newCellItem(id, index, model);
item.add(new AttributeModifier(class, new
ModelString(getCellStyleClass(;
item.add(new AttributeModifier(headers, getAccHeaderId(index)));
return item;
}

I guess you could pass the ItemIColumnT to your own getCellStyleClass()
method and grab the model from that Item to decide what CSS to apply.
~ Thank you,
Paul Bors

On Tue, Jan 29, 2013 at 4:49 AM, brazz alexander.li...@man.eu wrote:

 Hi,

 I have a datatable, want to check a td element tag for a certain class
 attribute and add a class attribute in certain constellations (highlight
 cell items). Last option is to copy code from datatable and modify it, but
 not very nice.

 Ho can i access the cell items of the table?

 My datatable looks like this:




 i tried overriting newCellItem. But newCellItem never gets called. And in
 newRowItem i'm not able to access child elements (i'm able to add an
 AttributeModifier to the rowItem, but that's not enough, i need it for cell
 items).

 @Override
 protected ItemT newRowItem(String id, int index, IModelT model)
 {
 OddEvenItemT eventItem = new OddEvenItemT(id, index,
 model);
 eventItem.add(createOnclickBehavior(model, eventItem));
 return eventItem;
 }

 @Override
 protected ItemT newCellItem(String id, int index, IModelT
 model) {
 // TODO Auto-generated method stub
 return super.newCellItem(id, index, model);
 }

 Many thanks for any suggestions!



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Access-read-and-modify-td-Tag-cell-tag-in-Datatable-tp4655872.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Access, read and modify td Tag (cell tag) in Datatable

2013-01-29 Thread brazz
Thanks for your reply,

there is only one method in class DataTable, but it is not called. Maybe
it's because i work with wicket 1.4.7.

protected ItemT newRowItem(final String id, int index, final IModelT
model)
{
return new ItemT(id, index, model);
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Access-read-and-modify-td-Tag-cell-tag-in-Datatable-tp4655872p4655888.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org