You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Arve Klev <ar...@gmail.com> on 2007/11/10 10:48:08 UTC

T5: Grid component, reorder and empty source

hi,
I am using the grid component to present the result from a search.
When the data source is empty,

<table t:type="grid" pagerPosition="both" source="persons" />

returns "There is no data to display." as expected.
but when I try to use the reorder parameter,

<table t:type="grid" pagerPosition="both" source="persons"
reorder="firstName" />

an application exception occur: "...grid: xxx -- no source to determine list
type from"

Is it supposed to be a non-empty datasource when using parameters like
reorder or remove?
(I am now reordering by get'ers and remove with @NonVisual in my
domain-model. Version is 5.0.6.)

thanks,

Arve Klev

Re: T5: Grid component, reorder and empty source

Posted by Arve Klev <ar...@gmail.com>.
Hi Marcus,

Thanks, thats easier.

Arve

2007/11/16, Marcus <mv...@gmail.com>:
>
> Hi Arve,
>
> We're using an if, to display grid only when it has data. Like this:
>
> Test.java:
> ...
> public boolean getHasDataToGrid1() { return (_listGrd1.size() > 0);  }
> ...
>
> Test.tml
> ...
> <t:if test="hasDataToGrid1">
>    <table t:type="grid" ....
> ...
>
>
> Marcus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: Grid component, reorder and empty source

Posted by Marcus <mv...@gmail.com>.
Hi Arve,

We're using an if, to display grid only when it has data. Like this:

Test.java:
...
public boolean getHasDataToGrid1() { return (_listGrd1.size() > 0);  }
...

Test.tml
...
<t:if test="hasDataToGrid1">
   <table t:type="grid" ....
...


Marcus

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


Re: T5: Grid component, reorder and empty source

Posted by Marcus <mv...@gmail.com>.
Hi Arve,

We're using an if to display grid only when it has data. Like this:

test.java:
...




On Nov 16, 2007 2:40 PM, adamh <ad...@azudio.co.uk> wrote:
>
> Hi Arve,
>
> Yep, I got it to work as well - I should have been a bit more persistent
> with my searching, still its little 'should be simple' things like this that
> can trip you up if you are new to the T5 way. Its just a question of the
> docs getting updated, I thought I saw talk of a grid section/tutorial
> somewhere.
>
>
>
> Arve Klev wrote:
> >
> > yes, it works fine.
> >
> >
> > 2007/11/16, Joshua Jackson <jo...@gmail.com>:
> >>
> >> On 11/16/07, Arve Klev <ar...@gmail.com> wrote:
> >> > hi,
> >> > as a novice in regards to Tapestry, I first thought it was a bug,
> >> > but at last I tried to supply a beanmodel, and everything is fine
> >> (obvious
> >> > to others, I think).
> >> > I found the tip here:
> >> >
> >> http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html
> >> .
> >> >
> >> > <table t:type="grid" pagerPosition="both" source="persons" model="
> >> > personModel" reorder="firstName" />
> >> >
> >> >    @Inject
> >> >    private BeanModelSource _beanModelSource;
> >> >
> >> >    @Inject
> >> >    private ComponentResources _resources;
> >> >
> >> >    @Retain
> >> >    private BeanModel _model;
> >> >
> >> >    public BeanModel getPersonModell() {
> >> >        return _model;
> >> >    }
> >> >
> >> >    void pageLoaded() {
> >> >        _model = _beanModelSource.create(Person.class, false,
> >> _resources);
> >> >    }
> >> >
> >> > Is this the right way to inform the grid component to use the "
> >> Person.class
> >> > "?
> >>
> >> Have you tried it yet?
> >>
> >>
> >> --
> >> What you want today, may not exist tommorrow
> >>
> >> Blog: http://joshuajava.wordpress.com/
> >>
> >> ---------------------------------------------------------------------
> >> 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-Grid-component%2C-reorder-and-empty-source-tf4782045.html#a13797863
> 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
>
>

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


Re: T5: Grid component, reorder and empty source

Posted by adamh <ad...@azudio.co.uk>.
Hi Arve,

Yep, I got it to work as well - I should have been a bit more persistent
with my searching, still its little 'should be simple' things like this that
can trip you up if you are new to the T5 way. Its just a question of the
docs getting updated, I thought I saw talk of a grid section/tutorial
somewhere.


Arve Klev wrote:
> 
> yes, it works fine.
> 
> 
> 2007/11/16, Joshua Jackson <jo...@gmail.com>:
>>
>> On 11/16/07, Arve Klev <ar...@gmail.com> wrote:
>> > hi,
>> > as a novice in regards to Tapestry, I first thought it was a bug,
>> > but at last I tried to supply a beanmodel, and everything is fine
>> (obvious
>> > to others, I think).
>> > I found the tip here:
>> >
>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html
>> .
>> >
>> > <table t:type="grid" pagerPosition="both" source="persons" model="
>> > personModel" reorder="firstName" />
>> >
>> >    @Inject
>> >    private BeanModelSource _beanModelSource;
>> >
>> >    @Inject
>> >    private ComponentResources _resources;
>> >
>> >    @Retain
>> >    private BeanModel _model;
>> >
>> >    public BeanModel getPersonModell() {
>> >        return _model;
>> >    }
>> >
>> >    void pageLoaded() {
>> >        _model = _beanModelSource.create(Person.class, false,
>> _resources);
>> >    }
>> >
>> > Is this the right way to inform the grid component to use the "
>> Person.class
>> > "?
>>
>> Have you tried it yet?
>>
>>
>> --
>> What you want today, may not exist tommorrow
>>
>> Blog: http://joshuajava.wordpress.com/
>>
>> ---------------------------------------------------------------------
>> 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-Grid-component%2C-reorder-and-empty-source-tf4782045.html#a13797863
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: T5: Grid component, reorder and empty source

Posted by Arve Klev <ar...@gmail.com>.
yes, it works fine.


2007/11/16, Joshua Jackson <jo...@gmail.com>:
>
> On 11/16/07, Arve Klev <ar...@gmail.com> wrote:
> > hi,
> > as a novice in regards to Tapestry, I first thought it was a bug,
> > but at last I tried to supply a beanmodel, and everything is fine
> (obvious
> > to others, I think).
> > I found the tip here:
> >
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html
> .
> >
> > <table t:type="grid" pagerPosition="both" source="persons" model="
> > personModel" reorder="firstName" />
> >
> >    @Inject
> >    private BeanModelSource _beanModelSource;
> >
> >    @Inject
> >    private ComponentResources _resources;
> >
> >    @Retain
> >    private BeanModel _model;
> >
> >    public BeanModel getPersonModell() {
> >        return _model;
> >    }
> >
> >    void pageLoaded() {
> >        _model = _beanModelSource.create(Person.class, false,
> _resources);
> >    }
> >
> > Is this the right way to inform the grid component to use the "
> Person.class
> > "?
>
> Have you tried it yet?
>
>
> --
> What you want today, may not exist tommorrow
>
> Blog: http://joshuajava.wordpress.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: Grid component, reorder and empty source

Posted by Joshua Jackson <jo...@gmail.com>.
On 11/16/07, Arve Klev <ar...@gmail.com> wrote:
> hi,
> as a novice in regards to Tapestry, I first thought it was a bug,
> but at last I tried to supply a beanmodel, and everything is fine (obvious
> to others, I think).
> I found the tip here:
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html.
>
> <table t:type="grid" pagerPosition="both" source="persons" model="
> personModel" reorder="firstName" />
>
>    @Inject
>    private BeanModelSource _beanModelSource;
>
>    @Inject
>    private ComponentResources _resources;
>
>    @Retain
>    private BeanModel _model;
>
>    public BeanModel getPersonModell() {
>        return _model;
>    }
>
>    void pageLoaded() {
>        _model = _beanModelSource.create(Person.class, false, _resources);
>    }
>
> Is this the right way to inform the grid component to use the "Person.class
> "?

Have you tried it yet?


-- 
What you want today, may not exist tommorrow

Blog: http://joshuajava.wordpress.com/

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


Re: T5: Grid component, reorder and empty source

Posted by Arve Klev <ar...@gmail.com>.
hi,
as a novice in regards to Tapestry, I first thought it was a bug,
but at last I tried to supply a beanmodel, and everything is fine (obvious
to others, I think).
I found the tip here:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html.

<table t:type="grid" pagerPosition="both" source="persons" model="
personModel" reorder="firstName" />

    @Inject
    private BeanModelSource _beanModelSource;

    @Inject
    private ComponentResources _resources;

    @Retain
    private BeanModel _model;

    public BeanModel getPersonModell() {
        return _model;
    }

    void pageLoaded() {
        _model = _beanModelSource.create(Person.class, false, _resources);
    }

Is this the right way to inform the grid component to use the "Person.class
"?


thanks,

Arve Klev

2007/11/13, adamh <ad...@azudio.co.uk>:
>
>
> I'm seeing the same behaviour, if my source is empty and I use the
> 'remove'
> parameter I get the same exception:
>
> 'grid: xxx -- no source to determine list type from'
>
> Results.tml
> <t:grid t:source="myResults" t:row="item" t:remove="Id,colour,name"
> t:rowsPerPage="10" width="620px">
>
> Removing the 'remove' param the page renders with the 'nothing to display'
> message.
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Grid-component%2C-reorder-and-empty-source-tf4782045.html#a13732796
> 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: T5: Grid component, reorder and empty source

Posted by adamh <ad...@azudio.co.uk>.
I'm seeing the same behaviour, if my source is empty and I use the 'remove'
parameter I get the same exception:

'grid: xxx -- no source to determine list type from'

Results.tml
<t:grid t:source="myResults" t:row="item" t:remove="Id,colour,name"
t:rowsPerPage="10" width="620px">

Removing the 'remove' param the page renders with the 'nothing to display'
message.

-- 
View this message in context: http://www.nabble.com/T5%3A-Grid-component%2C-reorder-and-empty-source-tf4782045.html#a13732796
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