Ok, but I still don't understand I'm afraid... what would instantiate and populate the Pageable object?
On Thu, 9 Feb 2017, 09:38 Arjun Gica Manipes, <[email protected]> wrote: > Hi Dan, > > Thank you for your response. > > We plan it to use on ViewModel only. There's no problem on DataNucleus. > We want to add an extra parameter (Pageable) to getProperty() method > located at CollectionAccessorFacetViaAccessor.java where the actual > invocation happens. > > ObjectAdapter.InvokeUtils.invoke(method, pageable, owningAdapter); > > > Thanks and best regards, > Arjun Gica Manipes > > -----Original Message----- > From: Dan Haywood [mailto:[email protected]] > Sent: Thursday, February 09, 2017 2:53 PM > To: [email protected] > Subject: Re: Apply pagination to collection (parented list) > > 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 <[email protected]> > 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 > > > > >
