Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Srividya Srividya Srividya
Problems when using the Liferay-ui:ratings tag for custom portlet
June 8, 2009 9:57 PM
Answer

Srividya Srividya Srividya

Rank: New Member

Posts: 1

Join Date: June 8, 2009

Recent Posts

Hi,

Actually our requirement is displaying video clips in a loop based on Timer, and for every video we need to display some information like rating,view count,video description.This timer concept we implemented using Javascript.

We tried to implement rating using liferay-ui:ratings tag.

<liferay-ui:ratings
className="<%= yourportlet.class.getName() %>"
classPK="<%= yourportlet.getResourcePrimKey() %>"
url='<%= themeDisplay.getPathMain() + "/relativepathtoaction" %>'
/>

Steps:

Add className - your portlet className
Add classprimarykey
finding your class primary key :
your portlet class primary key can be found by using request object

Sample:

<%
JournalArticleDisplay articleDisplay = (JournalArticleDisplay)request.getAttribute(WebKeys.JOURNAL_ARTICLE_DISPLAY);
%>

So here the question is how to put an entry in WebKeys.
Can you please explain the attribute classPK.