Fórum

Document & Media portlet pagination problem

thumbnail
Devang Patel, modificado 8 Anos atrás.

Document & Media portlet pagination problem

Regular Member Postagens: 247 Data de Entrada: 19/01/15 Postagens Recentes
Hi Team,

I am facing one problem in search conatainer of Document & Media Portlet.
I have 25 items like folders and documents in the portlet. When I change display items from 20 to 10 and sort the document using (sort by) option.
Then it displays all the items not 10 items which I set.
I am using Liferay 6.2 ga3.

Thanks
Devang Patel
thumbnail
Arun Das, modificado 8 Anos atrás.

RE: Document & Media portlet pagination problem

Regular Member Postagens: 166 Data de Entrada: 23/07/12 Postagens Recentes
Hi,
You can set the default value in portal-ext.properties file. search.container.page.default.delta=10
This will change the default display items count.

Arun
thumbnail
Devang Patel, modificado 8 Anos atrás.

RE: Document & Media portlet pagination problem

Regular Member Postagens: 247 Data de Entrada: 19/01/15 Postagens Recentes
Hi Arun Das,

Thanks for quick reply.
But my problem didn't solve.

I have 25 items like folders and documents in the portlet. When I change display items from 20 to 10 and sort the document using (sort by) option.
Then it displays all the items not 10 items which I set.
I am using Liferay 6.2 ga3.

I want to know which action is performed on clicking sort by button.
So that I can solve this issue.
Is this Liferay's Bug?

Thank You
Deavng Patel
thumbnail
Arun Das, modificado 8 Anos atrás.

RE: Document & Media portlet pagination problem (Resposta)

Regular Member Postagens: 166 Data de Entrada: 23/07/12 Postagens Recentes
Hi,
Yes it seems like a bug. You can create an hook on \webapps\ROOT\html\portlet\document_library\sort_button.jsp
Add in
int entryStart = ParamUtil.getInteger(request, "entryStart");
int entryEnd = ParamUtil.getInteger(request, "entryEnd", entriesPerPage);

and modify the script to
<aui:script>
Liferay.provide(
window,
'<portlet:namespace />sortEntries',
function(folderId, orderByCol, reverseOrderByType) {
Liferay.fire(
'<portlet:namespace />dataRequest',
{
requestParams: {
'<portlet:namespace />folderId': folderId,
'<portlet:namespace />navigation': '<%= HtmlUtil.escape(navigation) %>',
'<portlet:namespace />struts_action': '/document_library/view',
'<portlet:namespace />fileEntryTypeId': <%= fileEntryTypeId %>,
'<portlet:namespace />viewEntries': <%= Boolean.FALSE.toString() %>,
'<portlet:namespace />viewEntriesPage': <%= Boolean.TRUE.toString() %>,
'<portlet:namespace />viewFolders': <%= Boolean.FALSE.toString() %>,
'<portlet:namespace />orderByCol': orderByCol,
'<portlet:namespace />orderByType': reverseOrderByType,
'<portlet:namespace />entryStart': <%= entryStart %>,
'<portlet:namespace />entryEnd': <%= entryEnd %>,

'<portlet:namespace />saveOrderBy': <%= Boolean.TRUE.toString() %>
}
}
);
},
['aui-base']
);
</aui:script>


HTH
Arun
thumbnail
Devang Patel, modificado 8 Anos atrás.

RE: Document & Media portlet pagination problem

Regular Member Postagens: 247 Data de Entrada: 19/01/15 Postagens Recentes
Thanks Arun Das

It works.

Thank You,
Devang Patel
thumbnail
Arun Das, modificado 8 Anos atrás.

RE: Document & Media portlet pagination problem

Regular Member Postagens: 166 Data de Entrada: 23/07/12 Postagens Recentes
Hi,
I just updated the code. I think you need to have entryStart also.

Arun
thumbnail
Devang Patel, modificado 8 Anos atrás.

RE: Document & Media portlet pagination problem

Regular Member Postagens: 247 Data de Entrada: 19/01/15 Postagens Recentes
Hi Arun Das,
Thanks.
But It already works without entryStart.

Thank You
Devang Patel
thumbnail
Arun Das, modificado 8 Anos atrás.

RE: Document & Media portlet pagination problem

Regular Member Postagens: 166 Data de Entrada: 23/07/12 Postagens Recentes
Hi,
Yea. But when there are multiple pages and you go to some other page other than the first page and try to sort, I'm not sure that works well. I really haven't tested out that scenario. But I think if there is an end, there should be a start somewhere. You test out different scenarios and let us know.emoticon

Arun
thumbnail
Devang Patel, modificado 8 Anos atrás.

RE: Document & Media portlet pagination problem

Regular Member Postagens: 247 Data de Entrada: 19/01/15 Postagens Recentes
Arun Das:
Hi,
Yea. But when there are multiple pages and you go to some other page other than the first page and try to sort, I'm not sure that works well. I really haven't tested out that scenario. But I think if there is an end, there should be a start somewhere. You test out different scenarios and let us know.emoticon

Hi Arun,
Thanks for quick reply.
Yes, You are right.emoticon

We have to pass entryStart.

Thank You,
Devang Patel