Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay data from Custom Query(Joined tables) in liferay search container
    primarykey
    data
    text
    <p>I have followed <a href="http://www.liferay.com/community/wiki/-/wiki/Main/Custom+queries+in+Liferay+5.2" rel="nofollow" title="Liferay Wiki: Custom queries in Liferay 5.2">this wiki</a> and have successfully built a custom query.</p> <p>It works fine. I have used a join between tables.</p> <p>My question is how do I display it on a jsp using liferay search container since className in search container requires one model class.</p> <p><em><strong>EDIT:</em></strong><br> What I have tried till now is this:</p> <pre class="lang-java prettyprint-override"><code>&lt;% getAttendanceData attName = new getAttendanceData(); List&lt;Object[]&gt; displayAttListName = AttendanceLocalServiceUtil.findAttendance(); ArrayList name = new ArrayList(); ArrayList title = new ArrayList(); ArrayList status = new ArrayList(); ArrayList remarks = new ArrayList(); for(Object[] att:displayAttListName) { name.add(att[0]); title.add(att[1]); status.add(att[2]); remarks.add(att[3]); } %&gt; &lt;liferay-ui:search-container delta="20" emptyResultsMessage="No Results Found"&gt; &lt;liferay-ui:search-container-results total="&lt;%= displayAttListName.size() %&gt;" results="&lt;%= ListUtil.subList(displayAttListName , searchContainer.getStart(), searchContainer.getEnd()) %&gt;" /&gt; &lt;liferay-ui:search-container-row modelVar="search" className="java.lang.Object"&gt; &lt;% for(Object displayName:name) { %&gt; &lt;liferay-ui:search-container-column-text name='studName' value = '&lt;%=String.valueOf(displayName)%&gt;' href=""&gt; &lt;/liferay-ui:search-container-column-text&gt; &lt;% } %&gt; &lt;/liferay-ui:search-container-row&gt; &lt;liferay-ui:search-iterator/&gt; &lt;/liferay-ui:search-container&gt; </code></pre> <p>What I have done above displays each of the 10 names 10 times in a column.<br> I want the names to appear on each new row. How shoould I modify the above code?</p> <p><em><strong>EDIT 2</em></strong><br> Considering the <code>name</code> array defines earlier I did the following:</p> <pre class="lang-java prettyprint-override"><code>&lt;liferay-ui:search-container-column-text name="employee name" href = ""&gt; &lt;%=name.getClass().getDeclaredFields().toString() %&gt; &lt;/liferay-ui:search-container-column-text&gt; </code></pre> <p>With the above, I am getting the result something like: <code>[Ljava.lang.reflect.Field;@195f1af</code> on each row.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload