You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Erik de Hair <er...@pocos.nl> on 2014/05/19 13:46:27 UTC

customize list view

Hi,

How to manage which fields are displayed in a default list view (result of a repo finder method)? I can't find an example...

Thanks,
Erik

Re: customize list view

Posted by Erik de Hair <er...@pocos.nl>.
Created following issue: https://issues.apache.org/jira/browse/ISIS-791

Gr,
Erik


On 05/20/2014 11:24 AM, Dan Haywood wrote:

On 20 May 2014 07:47, Erik de Hair <er...@pocos.nl> wrote:



Ok, thanks. I thought there might be an other way of hiding fields per
finder/repo action.




This is a feature that's supported on Naked Objects MVC (our "sister"
project on .NET).

So by all means raise a ticket; it should be technically doable.

Dan






I tried to use a ViewModel but that's not the best solution in this
situation indeed.

Thanks,
Erik

On 05/19/2014 02:31 PM, Dan Haywood wrote:

Not sure I follow.

The annotations (or .layout.json) go on the result type.

So, if you have a service/repo action:

    public List<Customer> findCustomers(...) { ... }

then you should annotate the Customer class.

It isn't possible to specify different annotations per repo action.  If you
want this, you should instead define a view model as a wrapper for the
entity, eg:

    public List<CustomerViewModel1> findCustomers( ... ) {   ... }

    public List<CustomerViewModel2> findCustomersForSomeOtherPurpose( ... )
 { ... }

Try to minimize doing this though; lots of boilerplate to maintain, and it
isn't the Isis "way".


HTH
Dan





On 19 May 2014 13:15, Erik de Hair <er...@pocos.nl>
wrote:



I wanted to use the layout.json way because I have a lot of fields to hide
:-)

How do I match a json-layout with a single repo method?

Erik

On 05/19/2014 01:53 PM, Dan Haywood wrote:

You can use @Hidden(where=Where.STANDALONE_TABLES)  or ALL_TABLES   or
PARENTED_TABLES.

Also REFERENCES_PARENT is useful for parented tables, as it automatically
excludes the reference to a parent.

If you prefer to avoid annotations, use the dynamic layout.json instead.
 This has the advantage of not requiring a restart (if you are not using
JRebel, that is).

HTH
Dan



On 19 May 2014 12:46, Erik de Hair <er...@pocos.nl><mailto:erik@pocos.nl


<ma...@pocos.nl>


wrote:



Hi,

How to manage which fields are displayed in a default list view (result of
a repo finder method)? I can't find an example...

Thanks,
Erik



















Re: customize list view

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 20 May 2014 07:47, Erik de Hair <er...@pocos.nl> wrote:

> Ok, thanks. I thought there might be an other way of hiding fields per
> finder/repo action.
>

This is a feature that's supported on Naked Objects MVC (our "sister"
project on .NET).

So by all means raise a ticket; it should be technically doable.

Dan



>
> I tried to use a ViewModel but that's not the best solution in this
> situation indeed.
>
> Thanks,
> Erik
>
> On 05/19/2014 02:31 PM, Dan Haywood wrote:
>
> Not sure I follow.
>
> The annotations (or .layout.json) go on the result type.
>
> So, if you have a service/repo action:
>
>     public List<Customer> findCustomers(...) { ... }
>
> then you should annotate the Customer class.
>
> It isn't possible to specify different annotations per repo action.  If you
> want this, you should instead define a view model as a wrapper for the
> entity, eg:
>
>     public List<CustomerViewModel1> findCustomers( ... ) {   ... }
>
>     public List<CustomerViewModel2> findCustomersForSomeOtherPurpose( ... )
>  { ... }
>
> Try to minimize doing this though; lots of boilerplate to maintain, and it
> isn't the Isis "way".
>
>
> HTH
> Dan
>
>
>
>
>
> On 19 May 2014 13:15, Erik de Hair <er...@pocos.nl>
> wrote:
>
>
>
> I wanted to use the layout.json way because I have a lot of fields to hide
> :-)
>
> How do I match a json-layout with a single repo method?
>
> Erik
>
> On 05/19/2014 01:53 PM, Dan Haywood wrote:
>
> You can use @Hidden(where=Where.STANDALONE_TABLES)  or ALL_TABLES   or
> PARENTED_TABLES.
>
> Also REFERENCES_PARENT is useful for parented tables, as it automatically
> excludes the reference to a parent.
>
> If you prefer to avoid annotations, use the dynamic layout.json instead.
>  This has the advantage of not requiring a restart (if you are not using
> JRebel, that is).
>
> HTH
> Dan
>
>
>
> On 19 May 2014 12:46, Erik de Hair <er...@pocos.nl><mailto:erik@pocos.nl
> ><ma...@pocos.nl>
> wrote:
>
>
>
> Hi,
>
> How to manage which fields are displayed in a default list view (result of
> a repo finder method)? I can't find an example...
>
> Thanks,
> Erik
>
>
>
>
>
>
>
>
>
>
>
>
>

Re: customize list view

Posted by Erik de Hair <er...@pocos.nl>.
Ok, thanks. I thought there might be an other way of hiding fields per finder/repo action.

I tried to use a ViewModel but that's not the best solution in this situation indeed.

Thanks,
Erik

On 05/19/2014 02:31 PM, Dan Haywood wrote:

Not sure I follow.

The annotations (or .layout.json) go on the result type.

So, if you have a service/repo action:

    public List<Customer> findCustomers(...) { ... }

then you should annotate the Customer class.

It isn't possible to specify different annotations per repo action.  If you
want this, you should instead define a view model as a wrapper for the
entity, eg:

    public List<CustomerViewModel1> findCustomers( ... ) {   ... }

    public List<CustomerViewModel2> findCustomersForSomeOtherPurpose( ... )
 { ... }

Try to minimize doing this though; lots of boilerplate to maintain, and it
isn't the Isis "way".


HTH
Dan





On 19 May 2014 13:15, Erik de Hair <er...@pocos.nl> wrote:



I wanted to use the layout.json way because I have a lot of fields to hide
:-)

How do I match a json-layout with a single repo method?

Erik

On 05/19/2014 01:53 PM, Dan Haywood wrote:

You can use @Hidden(where=Where.STANDALONE_TABLES)  or ALL_TABLES   or
PARENTED_TABLES.

Also REFERENCES_PARENT is useful for parented tables, as it automatically
excludes the reference to a parent.

If you prefer to avoid annotations, use the dynamic layout.json instead.
 This has the advantage of not requiring a restart (if you are not using
JRebel, that is).

HTH
Dan



On 19 May 2014 12:46, Erik de Hair <er...@pocos.nl>
wrote:



Hi,

How to manage which fields are displayed in a default list view (result of
a repo finder method)? I can't find an example...

Thanks,
Erik













Re: customize list view

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Not sure I follow.

The annotations (or .layout.json) go on the result type.

So, if you have a service/repo action:

    public List<Customer> findCustomers(...) { ... }

then you should annotate the Customer class.

It isn't possible to specify different annotations per repo action.  If you
want this, you should instead define a view model as a wrapper for the
entity, eg:

    public List<CustomerViewModel1> findCustomers( ... ) {   ... }

    public List<CustomerViewModel2> findCustomersForSomeOtherPurpose( ... )
 { ... }

Try to minimize doing this though; lots of boilerplate to maintain, and it
isn't the Isis "way".


HTH
Dan





On 19 May 2014 13:15, Erik de Hair <er...@pocos.nl> wrote:

> I wanted to use the layout.json way because I have a lot of fields to hide
> :-)
>
> How do I match a json-layout with a single repo method?
>
> Erik
>
> On 05/19/2014 01:53 PM, Dan Haywood wrote:
>
> You can use @Hidden(where=Where.STANDALONE_TABLES)  or ALL_TABLES   or
> PARENTED_TABLES.
>
> Also REFERENCES_PARENT is useful for parented tables, as it automatically
> excludes the reference to a parent.
>
> If you prefer to avoid annotations, use the dynamic layout.json instead.
>  This has the advantage of not requiring a restart (if you are not using
> JRebel, that is).
>
> HTH
> Dan
>
>
>
> On 19 May 2014 12:46, Erik de Hair <er...@pocos.nl>
> wrote:
>
>
>
> Hi,
>
> How to manage which fields are displayed in a default list view (result of
> a repo finder method)? I can't find an example...
>
> Thanks,
> Erik
>
>
>
>
>
>
>

Re: customize list view

Posted by Erik de Hair <er...@pocos.nl>.
I wanted to use the layout.json way because I have a lot of fields to hide :-)

How do I match a json-layout with a single repo method?

Erik

On 05/19/2014 01:53 PM, Dan Haywood wrote:

You can use @Hidden(where=Where.STANDALONE_TABLES)  or ALL_TABLES   or
PARENTED_TABLES.

Also REFERENCES_PARENT is useful for parented tables, as it automatically
excludes the reference to a parent.

If you prefer to avoid annotations, use the dynamic layout.json instead.
 This has the advantage of not requiring a restart (if you are not using
JRebel, that is).

HTH
Dan



On 19 May 2014 12:46, Erik de Hair <er...@pocos.nl> wrote:



Hi,

How to manage which fields are displayed in a default list view (result of
a repo finder method)? I can't find an example...

Thanks,
Erik







Re: customize list view

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
You can use @Hidden(where=Where.STANDALONE_TABLES)  or ALL_TABLES   or
PARENTED_TABLES.

Also REFERENCES_PARENT is useful for parented tables, as it automatically
excludes the reference to a parent.

If you prefer to avoid annotations, use the dynamic layout.json instead.
 This has the advantage of not requiring a restart (if you are not using
JRebel, that is).

HTH
Dan



On 19 May 2014 12:46, Erik de Hair <er...@pocos.nl> wrote:

> Hi,
>
> How to manage which fields are displayed in a default list view (result of
> a repo finder method)? I can't find an example...
>
> Thanks,
> Erik
>