RE: [LF7.0GA5]How to create a new ResultRow

Diego Cantone, modified 7 Years ago. Junior Member Posts: 42 Join Date: 11/10/16 Recent Posts

Hi, 

in Liferay 6.2 i have some piece of code where has been used 

ResultRow row = new ResultRow(obj, n, i);

i noticed that in Liferay 7 i can't instantiate a ResultRow in this way, some one know if there is a similar alternative? A way to obtain the same result?

Thanks.

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts

In Liferay 6.2, the class was com.liferay.portal.kernel.dao.search.ResultRow, living in portal-service, which was present in the global class loader. In Liferay 7.0, that class was converted into an interface, and the implementation class was moved to com.liferay.taglib.search.ResultRow, living in util-taglib.

You can try adding a dependency on com.liferay.portal.util.taglib and switch your import to the implementation rather than the interface to see if it works. You can see an example of Liferay doing so in announcements-web, via an import in init.jsp, and there isn't anything special in the bnd.bnd or build.gradle.

Diego Cantone, modified 7 Years ago. Junior Member Posts: 42 Join Date: 11/10/16 Recent Posts

Thanks Minhchau Dang, the problem was that i were using the old import com.liferay.portal.kernel.dao.search.ResultRow; that now it's an interface, with the import com.liferay.taglib.search.ResultRow; it works!