Re: Forms and Grid questions ....

2010-12-28 Thread Thiago H. de Paula Figueiredo
On Tue, 28 Dec 2010 07:09:36 -0200, Gunnar Eketrapp  
 wrote:



Hi!


Hi!


My questions are:
1) How do I disable the sorting functionality of the grid.


Matheus answered that. :)


2) If I would like to suppport sorting and paging then I need some way to
first submit what's been checked.


I guess you can use some JavaScript in the paging links to do that.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Forms and Grid questions ....

2010-12-28 Thread Matheus Eduardo Machado Moreira
   Hi, Gunnar!

   I think I know how to answer your first question. I assume your are using
Tapestry 5.2.4 as I am. :-) You need to create an explicit BeanModel,
customize its sorting funcionality and provide it to your Grid component.

*Page class*

@Inject
private BeanModelSource beanModelSource;

@Inject
private Messages messages;

public BeanModel getUnsortableBeanModel() {
   BeanModel model = beanModelSource.createDisplayModel(YourModel.class,
messages);
   for (String propName : model.getPropertyNames()) {
  PropertyModel propModel = model.get(propName);
  propModel.sortable(false);
   }
}

*Page template*



   You can add a checkbox column using BeanModel.add("propertyName", null).
It will be necessary to provide a render block for it in the template
(...).

   Atenciosamente,

Matheus Eduardo Machado Moreira
matheus@gmail.com

*Good cooking takes time. If you are made to wait, it is to serve you
better, and to please you.*
Menu do Restaurant Antoine, New Orleans



2010/12/28 Gunnar Eketrapp 

> Hi!
>
> I am using a grid inside a form to display a list of name + checkbox.
>
> The user can then select a number of names and press OK (or cancel).
>
> My questions are:
>
> 1) How do I disable the sorting functionality of the grid.
>
> 2) If I would like to suppport sorting and paging then I need some way to
> first submit what's been checked.
>
> Or should I skip the grid !?
>
> Thanks in advance,
> Gunnar Eketrapp
>