You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by andre seame <an...@hotmail.fr> on 2016/03/09 18:41:08 UTC

Is there any pointers to change the markup header of a column or propertyColumn ?

Hello,


In DataTableFilterToolbarPag, we use columns.add(new PropertyColumn<Contact, String> ...


I would like to modify the content of the header of this column.


Must I do "replace the header component of the header of column" ? But how to do that?


Must i my own column objects? I imlagine that the header (th) is defined by the column. But how to do that?


Thanks,

PHL.

RE: Is there any pointers to change the markup header of a column or propertyColumn ?

Posted by andre seame <an...@hotmail.fr>.
Yes Tom, I would like to modify the header. 

So I modify the getHader method. If the column is not sortable, its work. if the column is sortable, myheader is inside the "sortable link border". In fact, I would like to set the sortable link inside a part of my header. 

Instead of : 
<th wicket:id="header" class="wicket_orderUp">
   <wicket:border xmlns:wicket="http://wicket.apache.org">
       <a href="..." wicket:id="orderByLink"><wicket:body><span wicket:id="label">Machine ....

I would like to have
th wicket:id="header" class="wicket_orderUp">
   <wicket:body><span wicket:id="label">Machine ....
   <wicket:border xmlns:wicket="http://wicket.apache.org">
       <a href="..." wicket:id="orderByLink"><wicket:body>Sort the machines</a>


This probably means that I have also to interact with the PropertyColumn.java 

Thanks, 
PHL

________________________________________
De : Tom Götz <to...@decoded.de>
Envoyé : mercredi 9 mars 2016 21:17
À : users@wicket.apache.org
Objet : Re: Is there any pointers to change the markup header of a column or propertyColumn ?

Hi,

I think the question was how to modify the *header* of the column and not the cell’s content. Therefore you only need to do the following:

@Override
Component getHeader(String componentId) {
    return new MyFancyHeaderPanel(componentId);
}

… in your PropertyColumn (anonymous) subclass.

Cheers,
   Tom


> On 09.03.2016, at 19:09, Francois Meillet <fr...@gmail.com> wrote:
>
> If you want to your own html, you need to create an object that extends PropertyColumn
>
> Let's say that XXXPropertyColumn extend PropertyColumn
>
> You need to override the populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) method
>
> for example
>
> @Override
> public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
>       item.add(new YYYPanel(item, componentId, rowModel));
> }
>
> Then you create the YYYPanel.java and the html file XXXPropertyColumn$YYYPanel.html with your own design.
>
>
> François
>
>
>
>
> Le 9 mars 2016 à 18:41, andre seame <an...@hotmail.fr> a écrit :
>
>>
>> Hello,
>>
>>
>> In DataTableFilterToolbarPag, we use columns.add(new PropertyColumn<Contact, String> ...
>>
>>
>> I would like to modify the content of the header of this column.
>>
>>
>> Must I do "replace the header component of the header of column" ? But how to do that?
>>
>>
>> Must i my own column objects? I imlagine that the header (th) is defined by the column. But how to do that?
>>
>>
>> Thanks,
>>
>> PHL.
>



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


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


Re: Is there any pointers to change the markup header of a column or propertyColumn ?

Posted by Tom Götz <to...@decoded.de>.
Hi,

I think the question was how to modify the *header* of the column and not the cell’s content. Therefore you only need to do the following:

@Override
Component getHeader(String componentId) {
    return new MyFancyHeaderPanel(componentId);
}

… in your PropertyColumn (anonymous) subclass.

Cheers,
   Tom


> On 09.03.2016, at 19:09, Francois Meillet <fr...@gmail.com> wrote:
> 
> If you want to your own html, you need to create an object that extends PropertyColumn
> 
> Let's say that XXXPropertyColumn extend PropertyColumn
> 
> You need to override the populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) method
> 
> for example
> 
> @Override
> public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
> 	item.add(new YYYPanel(item, componentId, rowModel));
> }
> 
> Then you create the YYYPanel.java and the html file XXXPropertyColumn$YYYPanel.html with your own design.
> 
> 
> François 
> 
> 
> 
> 
> Le 9 mars 2016 à 18:41, andre seame <an...@hotmail.fr> a écrit :
> 
>> 
>> Hello,
>> 
>> 
>> In DataTableFilterToolbarPag, we use columns.add(new PropertyColumn<Contact, String> ...
>> 
>> 
>> I would like to modify the content of the header of this column.
>> 
>> 
>> Must I do "replace the header component of the header of column" ? But how to do that?
>> 
>> 
>> Must i my own column objects? I imlagine that the header (th) is defined by the column. But how to do that?
>> 
>> 
>> Thanks,
>> 
>> PHL.
> 



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


Re: Is there any pointers to change the markup header of a column or propertyColumn ?

Posted by Francois Meillet <fr...@gmail.com>.
If you want to your own html, you need to create an object that extends PropertyColumn

Let's say that XXXPropertyColumn extend PropertyColumn

You need to override the populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) method

for example

@Override
public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
	item.add(new YYYPanel(item, componentId, rowModel));
}
    
Then you create the YYYPanel.java and the html file XXXPropertyColumn$YYYPanel.html with your own design.


François 




Le 9 mars 2016 à 18:41, andre seame <an...@hotmail.fr> a écrit :

> 
> Hello,
> 
> 
> In DataTableFilterToolbarPag, we use columns.add(new PropertyColumn<Contact, String> ...
> 
> 
> I would like to modify the content of the header of this column.
> 
> 
> Must I do "replace the header component of the header of column" ? But how to do that?
> 
> 
> Must i my own column objects? I imlagine that the header (th) is defined by the column. But how to do that?
> 
> 
> Thanks,
> 
> PHL.