Shivam Aggarwal
Shivam Aggarwal

Reputation: 805

Search container column jsp not working in liferay

The Search Container column jsp is not working in liferay.

I am trying to include a jsp within Liferay Search-container of type Document, for displaying search results for a given string.

Below is the snippet of code displaying search-container in the page:

<liferay-ui:search-container searchContainer="<%=tagsearchContainer%>"> 
    <liferay-ui:search-container-results>
            results="<%= hits.toList() %>"
            total="<%= hits.getLength() %>"
    </liferay-ui:search-container-results>

    <liferay-ui:search-container-row
        className="com.liferay.portal.kernel.search.Document"
        escapedModel="<%= false %>"
        keyProperty="UID"
        modelVar="document"
        stringKey="<%=true %>"
        >

        <liferay-ui:search-container-column-jsp path="/html/search_tag_result_form.jsp"/>

     </liferay-ui:search-container-row>

</liferay-ui:search-container>

The search container only displays all fields from the document,all mashed up,without any errors.It does not display the content from the jsp(actually does not include it,and does not throw even if wrong path for jsp is there).Mashed up results are displayed from container-row .

Upvotes: 2

Views: 2319

Answers (1)

Prakash K
Prakash K

Reputation: 11698

I think you are missing the <liferay-ui:search-iterator /> before the end-tag </liferay-ui:search-container>.

This <liferay-ui:search-iterator /> is used to actually displays the list and the contents inside the <liferay-ui:search-container-row> tag.

Here is a good explanation for most of the commonly used tags for search-container.

Upvotes: 2

Related Questions