0

What can I do with this scriptlet

<%
    ResultRow row = (ResultRow) request.getAttribute(BookAndAuthor.SEARCH_CONTAINER_RESULT_ROW);

    Book book = (Book) row.getObject();
%>

If I want to use value="${book.BookId} in this code?

<liferay-ui:icon-menu>

     <portlet:actionURL name="deleteBook" var="deleteBookVar">
         <portlet:param name="bookId"     value="<%=String.valueOf(book.getBookId())%>" />
     </portlet:actionURL>

</liferay-ui:icon-menu>
Roman C
  • 49,761
  • 33
  • 66
  • 176
Al.Boldyrev
  • 486
  • 7
  • 30

1 Answers1

0

This is a little tricky but I thing it should work. Use a variable to hold the value of the constant SEARCH_CONTAINER‌​_RESULT‌​_ROW

<c:set var="resultRowConstant" value="<%=BookAndAuthor.SEARCH_CONTAINER‌​_RESULT‌​_ROW%>" /> than to read the attribute you you should be able to use bracket notation to access 'dynamic' properties: <c:set var="row" value="${[resultRowConstant]}"/> and that will hold the ResultRow object, than you access your book object through

${row.object}
KlajdPaja
  • 959
  • 1
  • 8
  • 17