You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Everton Agner <ev...@yahoo.com.br> on 2010/01/09 18:09:30 UTC

How to disable column sorting on a Grid component?

Hi,

How can I do that? I haven't found anything about that. I only know that if I add one column to the Grid in the "add" attribute (or directly at it's BeanModel), it will not be part of the Sorting.

Thanks,

Everton



      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Res: How to disable column sorting on a Grid component?

Posted by Everton Agner <ev...@yahoo.com.br>.
Thank you! This is what I wanted to do...

But anyways, I could avoid doing this because of the sorting+activation context issues (i made the Entity object persistent in the page), but this will come come in handy in another situation.

Everton




________________________________
De: Thiago H. de Paula Figueiredo <th...@gmail.com>
Para: Tapestry users <us...@tapestry.apache.org>
Enviadas: Sábado, 9 de Janeiro de 2010 16:07:38
Assunto: Re: How to disable column sorting on a Grid component?

Em Sat, 09 Jan 2010 15:09:30 -0200, Everton Agner <ev...@yahoo.com.br> escreveu:

> Hi,

Hi!

> How can I do that? I haven't found anything about that. I only know that if I add one column to the Grid in the "add" attribute (or directly at it's BeanModel), it will not be part of the Sorting.

@Inject BeanModelSource to create a BeanModel yourserf. Then:

final List<String> propertyNames = model.getPropertyNames();
for (String propertyName : propertyNames) {
    model.get(propertyName).sortable(false);
}

Then pass this BeanModel instance to the model parameter of the Grid component. ;)

--Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: How to disable column sorting on a Grid component?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sat, 09 Jan 2010 15:09:30 -0200, Everton Agner  
<ev...@yahoo.com.br> escreveu:

> Hi,

Hi!

> How can I do that? I haven't found anything about that. I only know that  
> if I add one column to the Grid in the "add" attribute (or directly at  
> it's BeanModel), it will not be part of the Sorting.

@Inject BeanModelSource to create a BeanModel yourserf. Then:

final List<String> propertyNames = model.getPropertyNames();
for (String propertyName : propertyNames) {
	model.get(propertyName).sortable(false);
}

Then pass this BeanModel instance to the model parameter of the Grid  
component. ;)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


Res: Res: How to disable column sorting on a Grid component?

Posted by Everton Agner <ev...@yahoo.com.br>.
Thank you... Now I understand why the Grids cell parameter is named like p:LastNameCell... Unlike a BeanDisplay, where it would be just p:LastName.

This was kind of a workaround... Because if my page needs Activation Context, the ColumnSorting request didn't replicate it... So, i have to make the Page's entity object (that is loaded via the ID on the ActivationContext) Persistent.

Thanks,

Everton




________________________________
De: Juan E. Maya <ma...@gmail.com>
Para: Tapestry users <us...@tapestry.apache.org>
Enviadas: Sábado, 9 de Janeiro de 2010 15:29:57
Assunto: Re: Res: How to disable column sorting on a Grid component?

u can override the header using propertyHeader

It would be something like this:

<p:lastNameHeader>
  Last Name
</p:lastNameHeader>

This will override the generated markup removing the ordering.

On Sat, Jan 9, 2010 at 12:25 PM, Everton Agner
<ev...@yahoo.com.br> wrote:
> Oh, I still have the problem, because the TH's <a> is still there.
>
>
>
>
> ________________________________
> De: Everton Agner <ev...@yahoo.com.br>
> Para: Tapestry users <us...@tapestry.apache.org>
> Enviadas: Sábado, 9 de Janeiro de 2010 15:13:55
> Assunto: Res: How to disable column sorting on a Grid component?
>
> Oh, I didn't notice the IMG's "t-sort-icon" class... Now I can disable it in the CSS.
>
> But... There is a way so I can disable it directly at it's model?
>
> Thanks,
>
> Everton
>
>
>
>
> ________________________________
> De: Everton Agner <ev...@yahoo.com.br>
> Para: Tapestry Users <us...@tapestry.apache.org>
> Enviadas: Sábado, 9 de Janeiro de 2010 15:09:30
> Assunto: How to disable column sorting on a Grid component?
>
> Hi,
>
> How can I do that? I haven't found anything about that. I only know that if I add one column to the Grid in the "add" attribute (or directly at it's BeanModel), it will not be part of the Sorting.
>
> Thanks,
>
> Everton
>
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com

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


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: Res: How to disable column sorting on a Grid component?

Posted by "Juan E. Maya" <ma...@gmail.com>.
u can override the header using propertyHeader

It would be something like this:

<p:lastNameHeader>
  Last Name
 </p:lastNameHeader>

This will override the generated markup removing the ordering.

On Sat, Jan 9, 2010 at 12:25 PM, Everton Agner
<ev...@yahoo.com.br> wrote:
> Oh, I still have the problem, because the TH's <a> is still there.
>
>
>
>
> ________________________________
> De: Everton Agner <ev...@yahoo.com.br>
> Para: Tapestry users <us...@tapestry.apache.org>
> Enviadas: Sábado, 9 de Janeiro de 2010 15:13:55
> Assunto: Res: How to disable column sorting on a Grid component?
>
> Oh, I didn't notice the IMG's "t-sort-icon" class... Now I can disable it in the CSS.
>
> But... There is a way so I can disable it directly at it's model?
>
> Thanks,
>
> Everton
>
>
>
>
> ________________________________
> De: Everton Agner <ev...@yahoo.com.br>
> Para: Tapestry Users <us...@tapestry.apache.org>
> Enviadas: Sábado, 9 de Janeiro de 2010 15:09:30
> Assunto: How to disable column sorting on a Grid component?
>
> Hi,
>
> How can I do that? I haven't found anything about that. I only know that if I add one column to the Grid in the "add" attribute (or directly at it's BeanModel), it will not be part of the Sorting.
>
> Thanks,
>
> Everton
>
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com

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


Res: Res: How to disable column sorting on a Grid component?

Posted by Everton Agner <ev...@yahoo.com.br>.
Oh, I still have the problem, because the TH's <a> is still there.




________________________________
De: Everton Agner <ev...@yahoo.com.br>
Para: Tapestry users <us...@tapestry.apache.org>
Enviadas: Sábado, 9 de Janeiro de 2010 15:13:55
Assunto: Res: How to disable column sorting on a Grid component?

Oh, I didn't notice the IMG's "t-sort-icon" class... Now I can disable it in the CSS.

But... There is a way so I can disable it directly at it's model?

Thanks,

Everton




________________________________
De: Everton Agner <ev...@yahoo.com.br>
Para: Tapestry Users <us...@tapestry.apache.org>
Enviadas: Sábado, 9 de Janeiro de 2010 15:09:30
Assunto: How to disable column sorting on a Grid component?

Hi,

How can I do that? I haven't found anything about that. I only know that if I add one column to the Grid in the "add" attribute (or directly at it's BeanModel), it will not be part of the Sorting.

Thanks,

Everton



      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Res: How to disable column sorting on a Grid component?

Posted by Everton Agner <ev...@yahoo.com.br>.
Oh, I didn't notice the IMG's "t-sort-icon" class... Now I can disable it in the CSS.

But... There is a way so I can disable it directly at it's model?

Thanks,

Everton




________________________________
De: Everton Agner <ev...@yahoo.com.br>
Para: Tapestry Users <us...@tapestry.apache.org>
Enviadas: Sábado, 9 de Janeiro de 2010 15:09:30
Assunto: How to disable column sorting on a Grid component?

Hi,

How can I do that? I haven't found anything about that. I only know that if I add one column to the Grid in the "add" attribute (or directly at it's BeanModel), it will not be part of the Sorting.

Thanks,

Everton



      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com