Forums de discussion

Directory portlet customization(to avoid displaying results at page load )

thumbnail
naresh reddy, modifié il y a 12 années.

Directory portlet customization(to avoid displaying results at page load )

New Member Publications: 5 Date d'inscription: 20/02/10 Publications récentes
By default 'Directory Portlet' is displayed with available users list without clicking on searching button .i need not want to display the results when the page is loaded, i just want to display the results when user clicks search button.I tried using search container but not able to do it.Kindly help me to change the default behavoiur.
Thanks in advance
thumbnail
Anil Sunkari, modifié il y a 12 années.

RE: Directory portlet customization(to avoid displaying results at page loa

Expert Publications: 427 Date d'inscription: 12/08/09 Publications récentes
Hi Naresh,

For this you need to extend/customize the Directory Portlet from view perspective using hooks.If you are only concerned about users list display.

Thanks,
Anil Sunkari
thumbnail
naresh reddy, modifié il y a 12 années.

RE: Directory portlet customization(to avoid displaying results at page loa

New Member Publications: 5 Date d'inscription: 20/02/10 Publications récentes
This is the snippet where results are retrieved from DB.
if (searchTerms.isAdvancedSearch()) {
hits = UserLocalServiceUtil.search(company.getCompanyId(), searchTerms.getFirstName(), searchTerms.getMiddleName(), searchTerms.getLastName(), searchTerms.getScreenName(), searchTerms.getEmailAddress(), searchTerms.getActive(), userParams, searchTerms.isAndOperator(), searchContainer.getStart(), searchContainer.getEnd(), sort);
}
else {
hits = UserLocalServiceUtil.search(company.getCompanyId(), searchTerms.getKeywords(), searchTerms.getActive(), userParams, searchContainer.getStart(), searchContainer.getEnd(), sort);
}

it is just checking whether its an advanced search or not ?if not its just displaying the results.How can i restrict to avoid displaying results by just changing views.
iam not able to find where the action is fired to to display results by default in views.

Any ways thanks for ur reply.
thumbnail
Anil Sunkari, modifié il y a 12 années.

RE: Directory portlet customization(to avoid displaying results at page loa

Expert Publications: 427 Date d'inscription: 12/08/09 Publications récentes
I hope below snippet belongs to display results exactly while page loads.This sode comes from view_users.jsp from directory portlet.I suggest you to make it restricted with you condition/approaches.So that i believe you can achieve you view.

<liferay-ui:search-container-results>
<c:choose>
<c:when test="<%= PropsValues.USERS_SEARCH_WITH_INDEX %>">
<%@ include file="/html/portlet/enterprise_admin/user_search_results_index.jspf" %>
</c:when>
<c:otherwise>
<%@ include file="/html/portlet/enterprise_admin/user_search_results_database.jspf" %>
</c:otherwise>
</c:choose>
</liferay-ui:search-container-results>


Thanks,
Anil S
thumbnail
naresh reddy, modifié il y a 12 années.

RE: Directory portlet customization(to avoid displaying results at page loa

New Member Publications: 5 Date d'inscription: 20/02/10 Publications récentes
I too have the same idea but in order to make conditional i need to capture the event(clicking search button) but there he used below
tag library:
<liferay-ui:search-toggle
id="toggle_id_directory_user_search"
displayTerms="<%= displayTerms %>"
buttonLabel="search"
>............</liferay-ui:search-toggle>
Shall i need to use any scripting like<aui:script> ? if yes how can i use it to set value and pass it to conditional area.
Thanks for ur reply
Kaouther Ajala, modifié il y a 8 années.

RE: Directory portlet customization(to avoid displaying results at page loa

New Member Publications: 24 Date d'inscription: 10/02/15 Publications récentes
please give me the solution i have the same problem,i want to hide user list in directory portlet