Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Kiran Kumar Boyini
Getting exception while using iferay grid 6.0.6
November 23, 2012 6:19 AM
Answer

Kiran Kumar Boyini

Rank: Expert

Posts: 277

Join Date: June 2, 2011

Recent Posts

Hi All,

I am using liferay grd to get the my entity(Employee) records from the database.But I am getting java.lang.NullPointerException.

But the records are available in the database. I have used the following code as follows.
---------------------------------------------------------------------------------------------------------------------------------
<%
try{
List<com.vam.model.Employee> employeeList = new EmployeePersistenceImpl().findAll();
PortletURL viewURL = renderResponse.createRenderURL();%>
<liferay-ui:search-container iteratorURL="<%= viewURL %>" delta="10" emptyResultsMessage="No Results Found">
<liferay-ui:search-container-results total="<%= employeeList.size() %>"
results="<%= ListUtil.subList(employeeList, searchContainer.getStart(), searchContainer.getEnd()) %>" />
<liferay-ui:search-container-row modelVar="item" className="com.vam.model.Employee">
<liferay-ui:search-container-column-text name="Name" value="<%= item.getName()%>" href=""/>
<liferay-ui:search-container-column-text name="Address" value="<%= item.getAddress()%>" href=""/>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator searchContainer="<%= searchContainer %>" paginate="<%= true %>" />
</liferay-ui:search-container>
<%}
catch(Exception e){
System.out.println("***********Exceptoin raised**************"+e);
}
%>

----------------------------------------------------------------------------------------------
Please reply me ,I have imported all the packages.

Thanks,

Kiran
Hitoshi Ozawa
RE: Getting exception while using iferay grid 6.0.6
November 24, 2012 4:17 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

I haven't heard about liferay gird in 6.0.6. Can you tell me where it is?
Kiran Kumar Boyini
RE: Getting exception while using iferay grid 6.0.6
November 26, 2012 3:38 AM
Answer

Kiran Kumar Boyini

Rank: Expert

Posts: 277

Join Date: June 2, 2011

Recent Posts

Hi,


Liferay grid means it is a table which is given by liferay people using their frame works.you can see it in the admin module of liferay whike
displaying the users,in this page they are using liferay grid.

Thanks,

Kiran
Hitoshi Ozawa
RE: Getting exception while using iferay grid 6.0.6
November 26, 2012 3:06 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

You mean liferay's search container. From your code, you're using the search container. There's no data grid in liferay.

http://www.liferay.com/community/wiki/-/wiki/Main/SearchContainer

You'll have to tell us which row and which value is giving you a null pointer exception. Kind of difficult to find because you have a try-catch clause and that should pick up all the exceptions instead of raising null pointer exception.