Foren

Asset List screenlet not loading specified page of assets

thumbnail
Harish Kumar, geändert vor 8 Jahren.

Asset List screenlet not loading specified page of assets

Expert Beiträge: 483 Beitrittsdatum: 31.07.10 Neueste Beiträge
Hi,

Liferay Portal :- 6.2ee
Android Emulator : -Nexus _ 4_API_23
Liferay Screen:- 1.3.0

I am using "loadPage(pageNumber) " method in asset list screenlet .As documented in liferay screen , it loads the specified page of assets , but in my case it loads the first page assets.

_screenlet = (AssetListScreenlet)findViewById(R.id.asset_list_default);
_screenlet.setVisibility(View.VISIBLE);
_screenlet.setClassNameId(20109);
_screenlet.setFirstPageSize(4);
_screenlet.setPageSize(10);
_screenlet.setListener(this);
}

@Override
protected void onResume() {
super.onResume();

_screenlet.loadPage(15);
}


Total 295 assets are there. Do anybody faced any such issue ?

Regards,
Harish
thumbnail
Javier Gamarra, geändert vor 8 Jahren.

RE: Asset List screenlet not loading specified page of assets

Expert Beiträge: 348 Beitrittsdatum: 12.02.15 Neueste Beiträge
Investigating it right now.
thumbnail
Javier Gamarra, geändert vor 8 Jahren.

RE: Asset List screenlet not loading specified page of assets

Expert Beiträge: 348 Beitrittsdatum: 12.02.15 Neueste Beiträge
Ok, let's see how I explain it emoticon

The culprit is the default viewset that isn't aware of the page you are loading and tries to "fill the gaps", the default view implementation is now well suited for pagination, it follows the infinite scrolling pattern that is typical in mobile applications. We should haven't exposed that method or implemented a default viewset aware of that page...

The possible solutions are:
  • Use a hotfix solution that I've uploaded in my test bintray repository (1.3.2) that takes into account the page in the viewset and begins loading from that page.
  • Implement your viewset! I recommend you to follow this approach if you want some sort of pagination although is not a common pattern in android (I prefer infinite scrolling). I can guide you in the steps, it should be quite easy (and loadPage will work fine without trying to find the missing rows).
thumbnail
Harish Kumar, geändert vor 8 Jahren.

RE: Asset List screenlet not loading specified page of assets

Expert Beiträge: 483 Beitrittsdatum: 31.07.10 Neueste Beiträge
Hi Javier,

We are going to use infinite scrolling obviously. I came across this while investigating assetlist screenlet. So thought it would be better to share with you guys.

Regards,
Harish
thumbnail
Javier Gamarra, geändert vor 8 Jahren.

RE: Asset List screenlet not loading specified page of assets

Expert Beiträge: 348 Beitrittsdatum: 12.02.15 Neueste Beiträge
Thanks for noticing! emoticon