Hi Arjun,
and welcome to the mailing list.

Sounds like you've already delved quite a bit into the framework's inner
workings - that's nice to see!

It's not going to be possible to do pagination this way, I'm afraid, though
there is pagination support already available, implemented at the UI layer
rather than in the domain layer.

I was about to say that providing a Pageable as an arg will fail because
JDO/Datanucleus expects there to be a regular getter/setter to populate the
collection (assuming it's a regular "parented" collection), but actually
that's wrong - DN can just use the underlying instance field.

So, yes, the issue really is that getXxx(Pageable) isn't part of the Apache
Isis framework's coding conventions (aka programming model); as you've
uncovered it's current implementation ignores any getters that takes args.
There's perhaps an argument that it should throw an exception flagging the
fact that a getter with an arg is invalid.  By all means raise a ticket on
that if you wish via our JIRA... should be easy to implement.

My question to you is, with getXxx(Pageable), what would be responsible for
populating the Pageable object?

Meantime, to do pagination the way we currently have it designed, using
@CollectionLayout#paged [1]

HTH
Dan

[1] http://isis.apache.org/guides/rgant.html#_rgant-CollectionLayout_paged



On Thu, 9 Feb 2017 at 01:12 Arjun Gica Manipes <manipes...@sprobe.com>
wrote:

> Hi Dan,
>
> I'm quite new to Apache ISIS. And I am trying to apply pagination to
> Collections (parented list).
> What I am trying to do is to add extra parameter to the default getter
> method of the collection.
>
> @Collection(editing = Editing.DISABLED)
> @CollectionLayout(defaultView = "table")
> @Getter
> private List<Person> members = new ArrayList<>();
>
> The default getter method is:
> public List<Person> getMembers() {
> ...
> }
>
> I am trying to do this,
> public List<Person> getMembers(final Pageable pageable) {
> ...
> }
> Pageable contains parameters needed for pagination such us pageNumber,
> pageSize and etc.
>
> But the problem is it's not recognize as its getter because it has a
> parameter.
> So far, we have found out that the newly created method with parameter is
> remove via findAndRemoveCollectionAccessors() method located at
> CollectionAccessorFacetViaAccessorFactory.java
>
> Any idea or suggestion for its implementation?
>
>
> Thanks and best regards,
> Arjun Gica Manipes
>
>

Reply via email to