You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jeikrak <je...@gmail.com> on 2010/10/25 20:11:59 UTC
how to add ImageAjaxLink into datatable???
hi, i want to inserto in my datatable an image like this:
private ImageAjaxLink mailImg;
mailImg = new ImageAjaxLink("mailImg", bean.isMail()));
now my table is:
columns.add(new PropertyColumn(new StringResourceModel("label.col5", this,
null), "col5"));
provider = new TotalConsPagoProveedoresProvider("col1", false);
table = new DefaultDataTable("table", columns, provider, Integer.valueOf(new
StringResourceModel("rowsPerPage", this, null).getString())){
again, how can i add "mailImg" in "columns" of my table
tks!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-add-ImageAjaxLink-into-datatable-tp3011459p3011459.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: how to add ImageAjaxLink into datatable???
Posted by Michael O'Cleirigh <mi...@rivulet.ca>.
Hi,
The Column provides the component that is used for the cell in the table.
Look at subclassing property column and overriding this method:
public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel)
{
item.add(new Label(componentId, createLabelModel(rowModel)));
}
Instead of adding a label to the cell add in your ImageAjaxLink (or
whatever panel you need).
I would recommend creating a new concrete class to hold the new column
but you could use a dynamic inner class for prototyping purposes.
Regards,
Mike
> hi, i want to inserto in my datatable an image like this:
>
> private ImageAjaxLink mailImg;
>
> mailImg = new ImageAjaxLink("mailImg", bean.isMail()));
>
> now my table is:
>
> columns.add(new PropertyColumn(new StringResourceModel("label.col5", this,
> null), "col5"));
>
> provider = new TotalConsPagoProveedoresProvider("col1", false);
> table = new DefaultDataTable("table", columns, provider, Integer.valueOf(new
> StringResourceModel("rowsPerPage", this, null).getString())){
>
> again, how can i add "mailImg" in "columns" of my table
>
> tks!
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org