AbstractColumn get row object

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

AbstractColumn get row object

cosmindumy
Hello,
Maybe is newbie question but I couldn't figure out how to get the object of a row in a data table in a AbstractColumn.
I want to add a edit button as last cell in the row.
Here is my code:
List<IColumn<Person>> createTableColumns() {
...
columns.add( new EditColumn (...))
}
May I get the row object when I create the column?
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: AbstractColumn get row object

Sven Meier
Your column implementation gets a reference to the rowModel in
#populateItem().

Sven

On 10/22/2013 04:47 PM, cosmindumy wrote:

> Hello,
> Maybe is newbie question but I couldn't figure out how to get the object of
> a row in a data table in a AbstractColumn.
> I want to add a edit button as last cell in the row.
> Here is my code:
> List<IColumn&lt;Person>> createTableColumns() {
> ...
> columns.add( new EditColumn (...))
> }
> May I get the row object when I create the column?
> Thanks.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/AbstractColumn-get-row-object-tp4661924.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: AbstractColumn get row object

meduolis
This post was updated on .
In reply to this post by cosmindumy
If you are using DataTable as a repeater, this thread might help for you:
http://stackoverflow.com/questions/10796342/making-entire-row-of-a-wicket-datable-clickable

It lets you to make all row click-able. If you want to make single cell (column) click-able try to override newCellItem instead of newRowItem:
http://wicket.apache.org/apidocs/1.5/org/apache/wicket/extensions/markup/html/repeater/data/table/DataTable.html#newCellItem%28java.lang.String,%20int,%20org.apache.wicket.model.IModel%29
Reply | Threaded
Open this post in threaded view
|

Re: AbstractColumn get row object

cosmindumy
This post was updated on .
Thanks for replies.
I saved the reference in populateItem.
Cheers.