You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Adam Zimowski <zi...@gmail.com> on 2008/03/18 12:26:08 UTC

T5: your opinion on grid's sorting

I'd like to propose enhancement which makes it easier to define which
columns are sorted.

The grid component, as of 5.0.11, by default applies and enables
sorting to all columns. If one wants to change it, one must give grid
the model via "model" parameter. In the spirit of recently changed
default grid behavior ("include" parameter rather then "remove", and
"add" parameter which saves the need to mess with the model when
adding new columns), I'm wondering if similar evaluation (and possibly
change) of current sort defaults makes sense at this time.

What I'm proposing is a very unintrusive way to define which columns
are sortable. This does two things: allows to easily and quickly
define which columns are sortable via the markup, and removes the need
to work with model in page class. Do you folks find yourself disabling
sort most of the time only to seldom enable it for a column here and
there? Currently one must get the model, define sort, and expose it so
that it can be passed onto grid:

@Inject
private BeanModelSource _beanModelSource;
	
@Inject
private ComponentResources _componentResources;

private BeanModel<someclass> _model;

@OnEvent("activated")
void disableGridSort() {
 _model = _beanModelSource.create(someclass,  false, _componentResources);
 for(String property : _model.getPropertyNames())
  _model.get(property).sortable(false);
}

public BeanModel getModel() {
 return _model;
}

That's a lot of code for something that could be handled within the
template. Would't it be easier if we could do something along those
lines:

<t:grid t:source="articles" rowsPerPage="10" pagerPosition="bottom"
include="id*,text,author*,publishedDate" row="article"/>

The only new syntax is the star appended to column names in the
include parameter. If the column has a star appended, then it is to be
sortable so the grid should only enable sort on columns suffixed with
the star. If, on the other hand no column is suffixed with the star:

<t:grid t:source="articles" rowsPerPage="10" pagerPosition="bottom"
include="id,text,author,publishedDate" row="article"/>

then grid operates just as it does today, enabling sort on all
columns, which gives a nice backward compatibility.

I'd be happy to submit JIRA for this improvement, if I'm not the only
one who thinks this would be nice.

Regards,
-adam

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


Re: T5: your opinion on grid's sorting

Posted by Adam Zimowski <zi...@gmail.com>.
https://issues.apache.org/jira/browse/TAPESTRY-2292

Please, feel free to vote. Hopefully Howard blesses it :)

On Wed, Mar 19, 2008 at 2:52 AM, Andreas Pardeike <ap...@fsys.se> wrote:
> On 18 mar 2008, at 20.35, Howard Lewis Ship wrote:
>
>  > I see these little extra characters as a bit of a rabbit hole=; I'd
>  > rather add yet another parameter to identify which columns should be
>  > sortable
>
>  Also, in a lot of my apps, re-sorting the table should usually set the
>  paging to page 1. I guess that this might not be a candidate for default
>  behavior but a configuration option would be nice.
>
>  /Andreas Pardeike
>
>
>
>  ---------------------------------------------------------------------
>  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: T5: your opinion on grid's sorting

Posted by Andreas Pardeike <ap...@fsys.se>.
On 18 mar 2008, at 20.35, Howard Lewis Ship wrote:

> I see these little extra characters as a bit of a rabbit hole=; I'd
> rather add yet another parameter to identify which columns should be
> sortable

Also, in a lot of my apps, re-sorting the table should usually set the
paging to page 1. I guess that this might not be a candidate for default
behavior but a configuration option would be nice.

/Andreas Pardeike

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


Re: BeanEditForm & Zones

Posted by Howard Lewis Ship <hl...@gmail.com>.
Please add an issue to JIRA.

On Tue, Mar 18, 2008 at 1:35 PM, José Paumard <Jo...@orange.fr> wrote:
>
>  Hi all,
>
>  It seems to me that the BeanEditForm element could have a zone attribute.
> Am I wrong on this point, or maybe blind ?
>
>  José
>  --------------------------------------------------------------------- To
> unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org For additional
> commands, e-mail: users-help@tapestry.apache.org



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: T5: your opinion on grid's sorting

Posted by Howard Lewis Ship <hl...@gmail.com>.
I see these little extra characters as a bit of a rabbit hole=; I'd
rather add yet another parameter to identify which columns should be
sortable,

On Tue, Mar 18, 2008 at 12:09 PM, SergeEby <sd...@hotmail.com> wrote:
>
>  You are not alone :)
>
>  /Serge
>
>
>
>
>  Adam Zimowski wrote:
>  >
>  > I'd like to propose enhancement which makes it easier to define which
>  > columns are sorted.
>  >
>  > The grid component, as of 5.0.11, by default applies and enables
>  > sorting to all columns. If one wants to change it, one must give grid
>  > the model via "model" parameter. In the spirit of recently changed
>  > default grid behavior ("include" parameter rather then "remove", and
>  > "add" parameter which saves the need to mess with the model when
>  > adding new columns), I'm wondering if similar evaluation (and possibly
>  > change) of current sort defaults makes sense at this time.
>  >
>  > What I'm proposing is a very unintrusive way to define which columns
>  > are sortable. This does two things: allows to easily and quickly
>  > define which columns are sortable via the markup, and removes the need
>  > to work with model in page class. Do you folks find yourself disabling
>  > sort most of the time only to seldom enable it for a column here and
>  > there? Currently one must get the model, define sort, and expose it so
>  > that it can be passed onto grid:
>  >
>  > @Inject
>  > private BeanModelSource _beanModelSource;
>  >
>  > @Inject
>  > private ComponentResources _componentResources;
>  >
>  > private BeanModel<someclass> _model;
>  >
>  > @OnEvent("activated")
>  > void disableGridSort() {
>  >  _model = _beanModelSource.create(someclass,  false, _componentResources);
>  >  for(String property : _model.getPropertyNames())
>  >   _model.get(property).sortable(false);
>  > }
>  >
>  > public BeanModel getModel() {
>  >  return _model;
>  > }
>  >
>  > That's a lot of code for something that could be handled within the
>  > template. Would't it be easier if we could do something along those
>  > lines:
>  >
>  > <t:grid t:source="articles" rowsPerPage="10" pagerPosition="bottom"
>  > include="id*,text,author*,publishedDate" row="article"/>
>  >
>  > The only new syntax is the star appended to column names in the
>  > include parameter. If the column has a star appended, then it is to be
>  > sortable so the grid should only enable sort on columns suffixed with
>  > the star. If, on the other hand no column is suffixed with the star:
>  >
>  > <t:grid t:source="articles" rowsPerPage="10" pagerPosition="bottom"
>  > include="id,text,author,publishedDate" row="article"/>
>  >
>  > then grid operates just as it does today, enabling sort on all
>  > columns, which gives a nice backward compatibility.
>  >
>  > I'd be happy to submit JIRA for this improvement, if I'm not the only
>  > one who thinks this would be nice.
>  >
>  > Regards,
>  > -adam
>  >
>  > ---------------------------------------------------------------------
>  > 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/T5%3A-your-opinion-on-grid%27s-sorting-tp16119022p16128507.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
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: T5: your opinion on grid's sorting

Posted by SergeEby <sd...@hotmail.com>.
You are not alone :)

/Serge


Adam Zimowski wrote:
> 
> I'd like to propose enhancement which makes it easier to define which
> columns are sorted.
> 
> The grid component, as of 5.0.11, by default applies and enables
> sorting to all columns. If one wants to change it, one must give grid
> the model via "model" parameter. In the spirit of recently changed
> default grid behavior ("include" parameter rather then "remove", and
> "add" parameter which saves the need to mess with the model when
> adding new columns), I'm wondering if similar evaluation (and possibly
> change) of current sort defaults makes sense at this time.
> 
> What I'm proposing is a very unintrusive way to define which columns
> are sortable. This does two things: allows to easily and quickly
> define which columns are sortable via the markup, and removes the need
> to work with model in page class. Do you folks find yourself disabling
> sort most of the time only to seldom enable it for a column here and
> there? Currently one must get the model, define sort, and expose it so
> that it can be passed onto grid:
> 
> @Inject
> private BeanModelSource _beanModelSource;
> 	
> @Inject
> private ComponentResources _componentResources;
> 
> private BeanModel<someclass> _model;
> 
> @OnEvent("activated")
> void disableGridSort() {
>  _model = _beanModelSource.create(someclass,  false, _componentResources);
>  for(String property : _model.getPropertyNames())
>   _model.get(property).sortable(false);
> }
> 
> public BeanModel getModel() {
>  return _model;
> }
> 
> That's a lot of code for something that could be handled within the
> template. Would't it be easier if we could do something along those
> lines:
> 
> <t:grid t:source="articles" rowsPerPage="10" pagerPosition="bottom"
> include="id*,text,author*,publishedDate" row="article"/>
> 
> The only new syntax is the star appended to column names in the
> include parameter. If the column has a star appended, then it is to be
> sortable so the grid should only enable sort on columns suffixed with
> the star. If, on the other hand no column is suffixed with the star:
> 
> <t:grid t:source="articles" rowsPerPage="10" pagerPosition="bottom"
> include="id,text,author,publishedDate" row="article"/>
> 
> then grid operates just as it does today, enabling sort on all
> columns, which gives a nice backward compatibility.
> 
> I'd be happy to submit JIRA for this improvement, if I'm not the only
> one who thinks this would be nice.
> 
> Regards,
> -adam
> 
> ---------------------------------------------------------------------
> 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/T5%3A-your-opinion-on-grid%27s-sorting-tp16119022p16128507.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