フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Joerg Schaefer
using the tag <liferay-ui:ratings-score/> in portlets
2008/11/03 1:47
答え

Joerg Schaefer

ランク: Junior Member

投稿: 60

参加年月日: 2008/05/05

最近の投稿

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/04/02 4:27
答え

saumil nitin baxi

ランク: Junior Member

投稿: 37

参加年月日: 2008/04/06

最近の投稿

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/04/02 6:05
答え

Bruno Farache

LIFERAY STAFF

ランク: Liferay Master

投稿: 502

参加年月日: 2007/05/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 22: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/01/09 3:07
答え

pawan chauhan

ランク: Junior Member

投稿: 75

参加年月日: 2012/10/08

最近の投稿

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.