You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by tiptip <ma...@yahoo.com> on 2008/08/19 16:12:06 UTC

How to control column sorting in GRID?

Hi
I am working on my first Tapestry application with T5.
I am using Grid for reports pages and I found that it provide few columns as
sortable but not all (those that are added in bean model with "add" are not
seen as sortable column). My question is how do I enable all columns as
sortable column? And How do I NOT make any column sortable?

Thanks
-Tiptip

-- 
View this message in context: http://n2.nabble.com/How-to-control-column-sorting-in-GRID--tp733167p733167.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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


Re: How to control column sorting in GRID?

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

See Providing the BeanModel in the docs:
http://tapestry.apache.org/tapestry5/guide/beaneditform.html

-Filip

On 2008-08-19 17:36, tiptip wrote:
> Thanks for the Reply. But I dont know how to implement your suggestion.
> Can u please provide some example?
> 
> 
> Here is code snippet from my tml file:
> 
> <t:grid t:source="regionPools" row="pool" rowsPerPage="20"
> pagerPosition="both" rowClass="${rowClass}"
> 	exclude="updatedBy, updatedOn, createdBy, createdOn"
> 	add="programYear,regionCode, regionName"
> 	reorder="programYear, regionCode, regionName, baseAllocation,
> adjustmentAmount, balance, numberOfAdjustments">
> 	<t:parameter name="programYearCell">
> 		${pool.programYear.prgYear}
>         	</t:parameter>
> 	<t:parameter name="regionCodeCell">
> 		${pool.region.code} 
>         	</t:parameter>
>         	<t:parameter name="regionNameCell">		 	
> 		${pool.region.name}			
>         	</t:parameter>        
> </t:grid>
> 
> Here is my bean:
> 
> public class RegionPool extends Pool implements Serializable {
> 
> 	private static final long serialVersionUID = 4923140826612380850L;
> 
> 	private Region _region;
> 	private long _adjustmentAmount;
> 	private long _numberOfAdjustments;
> 	
> 	public RegionPool(Region region, ProgramYear programYear,
> 			long baseAllocation) {
> 		super(programYear, baseAllocation, 0);
> 		_region = region;
> 	}
> 	
> 	// other getter and setter method			
> }
> 
> Thanks,
>  tiptip
> 
> 
> 
> Filip S. Adamsen-2 wrote:
>> Hi,
>>
>> BeanModel#add returns a PropertyModel that has a sortable method to set 
>> whether or not the column representing the property is sortable.
>>
>> For properties you don't add explicity, you can use BeanModel#get or 
>> BeanModel#getById to get the PropertyModel.
>>
>> -Filip
>>
>> On 2008-08-19 16:12, tiptip wrote:
>>> Hi
>>> I am working on my first Tapestry application with T5.
>>> I am using Grid for reports pages and I found that it provide few columns
>>> as
>>> sortable but not all (those that are added in bean model with "add" are
>>> not
>>> seen as sortable column). My question is how do I enable all columns as
>>> sortable column? And How do I NOT make any column sortable?
>>>
>>> Thanks
>>> -Tiptip
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 

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


Re: How to control column sorting in GRID?

Posted by tiptip <ma...@yahoo.com>.
Thanks for the Reply. But I dont know how to implement your suggestion.
Can u please provide some example?


Here is code snippet from my tml file:

<t:grid t:source="regionPools" row="pool" rowsPerPage="20"
pagerPosition="both" rowClass="${rowClass}"
	exclude="updatedBy, updatedOn, createdBy, createdOn"
	add="programYear,regionCode, regionName"
	reorder="programYear, regionCode, regionName, baseAllocation,
adjustmentAmount, balance, numberOfAdjustments">
	<t:parameter name="programYearCell">
		${pool.programYear.prgYear}
        	</t:parameter>
	<t:parameter name="regionCodeCell">
		${pool.region.code} 
        	</t:parameter>
        	<t:parameter name="regionNameCell">		 	
		${pool.region.name}			
        	</t:parameter>        
</t:grid>

Here is my bean:

public class RegionPool extends Pool implements Serializable {

	private static final long serialVersionUID = 4923140826612380850L;

	private Region _region;
	private long _adjustmentAmount;
	private long _numberOfAdjustments;
	
	public RegionPool(Region region, ProgramYear programYear,
			long baseAllocation) {
		super(programYear, baseAllocation, 0);
		_region = region;
	}
	
	// other getter and setter method			
}

Thanks,
 tiptip



Filip S. Adamsen-2 wrote:
> 
> Hi,
> 
> BeanModel#add returns a PropertyModel that has a sortable method to set 
> whether or not the column representing the property is sortable.
> 
> For properties you don't add explicity, you can use BeanModel#get or 
> BeanModel#getById to get the PropertyModel.
> 
> -Filip
> 
> On 2008-08-19 16:12, tiptip wrote:
>> Hi
>> I am working on my first Tapestry application with T5.
>> I am using Grid for reports pages and I found that it provide few columns
>> as
>> sortable but not all (those that are added in bean model with "add" are
>> not
>> seen as sortable column). My question is how do I enable all columns as
>> sortable column? And How do I NOT make any column sortable?
>> 
>> Thanks
>> -Tiptip
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-control-column-sorting-in-GRID--tp19051338p19052943.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: How to control column sorting in GRID?

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

BeanModel#add returns a PropertyModel that has a sortable method to set 
whether or not the column representing the property is sortable.

For properties you don't add explicity, you can use BeanModel#get or 
BeanModel#getById to get the PropertyModel.

-Filip

On 2008-08-19 16:12, tiptip wrote:
> Hi
> I am working on my first Tapestry application with T5.
> I am using Grid for reports pages and I found that it provide few columns as
> sortable but not all (those that are added in bean model with "add" are not
> seen as sortable column). My question is how do I enable all columns as
> sortable column? And How do I NOT make any column sortable?
> 
> Thanks
> -Tiptip
> 

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