论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Joerg Schaefer
using the tag <liferay-ui:ratings-score/> in portlets
2008年11月3日 上午1:47
答复

Joerg Schaefer

等级: Junior Member

帖子: 60

加入日期: 2008年5月5日

最近的帖子

Hi,
i want to use the nice tag <liferay-ui:ratings-score/> in my own portlet.
I've tried it, but i get JavaScript-Errors (invalid object initializer).
Is it possible to use the tag in own portlets?
What are the steps i have to do?

In my test i put the both taglibs in my jsp header

<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>

and then i used the tag (for example <liferay-ui:ratings-score score="3.2" />)

I have found out, that the JavaScript for this tag is in portal.js.
I don't know, if my own portlets can access the portal.js.

I hope anyone has an idea.

Thanks

Jörg
saumil nitin baxi
RE: using the tag <liferay-ui:ratings-score/> in portlets
2009年4月2日 上午4:27
答复

saumil nitin baxi

等级: Junior Member

帖子: 37

加入日期: 2008年4月6日

最近的帖子

Joerg Schaefer:
Hi,
i want to use the nice tag <liferay-ui:ratings-score/> in my own portlet.
I've tried it, but i get JavaScript-Errors (invalid object initializer).
Is it possible to use the tag in own portlets?
What are the steps i have to do?

In my test i put the both taglibs in my jsp header

<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>

and then i used the tag (for example <liferay-ui:ratings-score score="3.2" />)

I have found out, that the JavaScript for this tag is in portal.js.
I don't know, if my own portlets can access the portal.js.

I hope anyone has an idea.

Thanks

Jörg


Yes you can do it in your own portlet. Make sure you have everything_packed.js in your page. Is your theme classic or your home made theme? turn into classic if it is not and try again ..
Bruno Farache
RE: using the tag <liferay-ui:ratings-score/> in portlets
2009年4月2日 上午6:05
答复

Bruno Farache

LIFERAY STAFF

等级: Liferay Master

帖子: 502

加入日期: 2007年5月14日

最近的帖子

Joerg, your auto-reply tool has been spamming this forum and unfortunately we don't automatically detect these type of messages, I had to delete them manually and ban you temporarily.

Please, let me know when you are back or turn this off so I can unban you. You can leave me a message in my wall:
http://www.liferay.com/web/bfarache

Have a nice vacation emoticon
Mazhar Alam
RE: using the tag <liferay-ui:ratings-score/> in portlets
2012年12月26日 下午10:55
答复

Mazhar Alam

等级: Regular Member

帖子: 188

加入日期: 2011年11月25日

最近的帖子

Hi You can use this code instead-
String className = Cause.class.getName();
long classPK = cause.getCauseId();
ratingsStats = RatingsStatsLocalServiceUtil.getStats(className, classPK);
avgScore = ratingsStats.getAverageScore();

and then print here-
<liferay-ui:ratings-score
score ="<%=avgScore %>" />
HTH
pawan chauhan
RE: using the tag <liferay-ui:ratings-score/> in portlets
2013年1月9日 上午3:07
答复

pawan chauhan

等级: Junior Member

帖子: 75

加入日期: 2012年10月8日

最近的帖子

Hi Mazhar,

I have used your code and ity works very smoothly emoticon..
But now i am doing an inter-portlet thing..
My two portlets work on the same class (say Announcement)...
Is there any one i can link them.

Please Advise,
Regards,
Pawan Chauhan.