On 20 May 2014 07:47, Erik de Hair <[email protected]> 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 <[email protected]><mailto:[email protected]>
> 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 <[email protected]><mailto:[email protected]
> ><mailto:[email protected]><mailto:[email protected]>
> 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
>
>
>
>
>
>
>
>
>
>
>
>
>

Reply via email to