Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Alex Curtui
Liferay Search - Search Toggle
November 14, 2012 4:13 AM
Answer

Alex Curtui

Rank: Junior Member

Posts: 30

Join Date: November 8, 2012

Recent Posts

Hello,

I wrote the following code
 1<liferay-ui:search-container delta="5" emptyResultsMessage="no-users-were-found" orderByCol="<%= orderByCol %>" orderByType="<%= orderByType %>">
 2
 3    <liferay-ui:search-container-results
 4        results="<%= ContactsPortlet.getUsersFiltered(request, searchContainer.getStart(), searchContainer.getEnd(), orderByComparator) %>"
 5        total="<%= ContactsPortlet.userSize %>" />
 6
 7    <liferay-ui:search-container-row
 8        className="com.contacts.model.UserInterface" keyProperty="firstName"
 9        modelVar="user">
10       
11        <liferay-ui:search-container-column-text name="First Name"
12            value="<%= user.getFirstName() %>" orderable="true"
13            orderableProperty="firstName" />
14
15        <liferay-ui:search-container-column-text name="Last Name"
16            value="<%= user.getLastName() %>"
17            orderable="true" orderableProperty="lastName" />
18
19        <liferay-ui:search-container-column-text name="Phone Number"
20            value="<%= user.getPhonesString() %>" />
21
22        <liferay-ui:search-container-column-text name="Department"
23            value="<%= user.getDepartment() %>" orderable="true"
24            orderableProperty="department" />
25
26        <liferay-ui:search-container-column-text name="Building"
27            value="<%= user.getBuilding() %>" orderable="true"
28            orderableProperty="building" />
29            
30    </liferay-ui:search-container-row>
31    <liferay-ui:search-iterator />
32</liferay-ui:search-container>


which displays a list of users. My problem is that I need to have two types of search: simple and advanced.
I know that I should use
1<liferay-ui:search-form page="/html/contactsportlet/viewForm.jsp" />
where viewForm.jsp should contain a liferay-ui:search-toggle, but that's all I know.

Thank you in advance,
Alex C.