掲示板

Asset List screenlet not loading specified page of assets

thumbnail
8年前 に Harish Kumar によって更新されました。

Asset List screenlet not loading specified page of assets

Expert 投稿: 483 参加年月日: 10/07/31 最新の投稿
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
8年前 に Javier Gamarra によって更新されました。

RE: Asset List screenlet not loading specified page of assets

Expert 投稿: 348 参加年月日: 15/02/12 最新の投稿
Investigating it right now.
thumbnail
8年前 に Javier Gamarra によって更新されました。

RE: Asset List screenlet not loading specified page of assets

Expert 投稿: 348 参加年月日: 15/02/12 最新の投稿
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
8年前 に Harish Kumar によって更新されました。

RE: Asset List screenlet not loading specified page of assets

Expert 投稿: 483 参加年月日: 10/07/31 最新の投稿
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
8年前 に Javier Gamarra によって更新されました。

RE: Asset List screenlet not loading specified page of assets

Expert 投稿: 348 参加年月日: 15/02/12 最新の投稿
Thanks for noticing! emoticon