I have been using search container in liferay to display data from a table. Works well!! here is a snippet of code:
<%
List<testapp> pendingApprovals = ActionClass.getPendingLeaveApplications();
%>
<liferay-ui:search-container delta="20" emptyResultsMessage="No Results Found">
<liferay-ui:search-container-results total="<%= pendingApprovals.size() %>"
results="<%= ListUtil.subList(pendingApprovals , searchContainer.getStart(), searchContainer.getEnd()) %>" />
<liferay-ui:search-container-row keyProperty = "empId" modelVar="search"
className="com.test.mis.portal.model.testapp">
<liferay-ui:search-container-column-text name='Leave Duration' value = '<%=String.valueOf(search.getLeaveDuration())%>' href="" />
</liferay-ui:search-container-row>
<liferay-ui:search-iterator/>
</liferay-ui:search-container>
Using the above code I display data from the testapp table based on some condition. In the same code I would like to add a row and display data. The data for this row should come from another table. In short I want to display data using search container from two different database tables. Is it possible to do? My requirement is such that data comes from two different tables
EDITED SECTION WITH REQUIREMENT I have Employee table with some fields I have another table Leave with some Fields. empId is in Leave table which maps to Employee table.
I have a search container whicg displays the data from the Leave table only if the leave is pending I want to display only those fields from Employee table which match with Leave table and satisfy the above condition.