Forums

angle-left Back

Use Primefaces commentbox in liferay

AG
Alireza Goli, modified 11 Months ago.

Use Primefaces commentbox in liferay

New Member Posts: 10 Join Date: 7/24/17 Recent Posts
Hi,
Is there any way to use primefaces commentbox inside liferay portlets?
commentbox project:
http://www.whitebyte.info/programming/introduction-into-commentbox
https://github.com/nickrussler/commentbox

I tried but I got some errors:
ERROR [BaseURLEncodedStringImpl:56] URL path must start with a '/' or include '://'
java.lang.IllegalArgumentException: URL path must start with a '/' or include '://'

Thanks,
Alireza
Neil Griffin, modified 11 Months ago.

RE: Use Primefaces commentbox in liferay

LIFERAY STAFF Liferay Legend Posts: 2540 Join Date: 7/26/05 Recent Posts
Hi Alireza,

I didn't know about the CommentBox project -- thank you for bringing it to my attention.

I built the project from source and was able to reproduce a problem similar to the one you reported. Upon further investigation, I saw that the project depends on an old/missing primefaces.css resource (from PrimeFaces 3.5, a fairly old version) and then I saw that the most recent commit states that the CommentBox project is no longer maintained.

So I'm sad to say that unless you fork the project and bring it up-to-date with PrimeFaces 6.1 and JSF 2.2, then it will not be possible to use it in a modern PrimeFaces webapp or portlet application.

Kind Regards,

Neil
Marcel Trotzek, modified 11 Months ago.

RE: Use Primefaces commentbox in liferay

New Member Posts: 9 Join Date: 10/1/13 Recent Posts
Hi Alireza,

We are actually using the commentbox component for our Scrum Portlet since Liferay 6 and had exactly the same problem when migrating to Liferay 7. I have therefore built the project myself (which I already did before due to a few other problems) and was able to use it with PrimeFaces 6.1 and Liferay 7.

As Neil already mentioned, the issue is mainly caused by outdated references and a few equally outdated passages in the Facelet code, like references to widgetVars. If this is an option for you, you can easily fix these by building the project from source as well. Let me know if you need help with any specific issue. If I find some time for this, I might create a fork of commentbox with these changes.
AG
Alireza Goli, modified 11 Months ago.

RE: Use Primefaces commentbox in liferay

New Member Posts: 10 Join Date: 7/24/17 Recent Posts
Hi,
Yes I will fork the project and change it.
thank you Neil and Marcel,
Alireza
Marcel Trotzek, modified 10 Months ago.

RE: Use Primefaces commentbox in liferay

New Member Posts: 9 Join Date: 10/1/13 Recent Posts
Hi again,

In case you (or someone else) still needs an updated version of commentbox, we have now published our version on GitHub: github.com/rtg-portale/commentbox

This version has been modified to work with PrimeFaces 6.1 (and Liferay 7) and is used for our own Scrum Portlet. We have not tested it in a standalone JSF application yet and can only guarantee that the features we use in our portlet work. We will check the rest as soon as possible and can maintain this fork if some people are interested. Let me know if you should encounter any problems.
KN
Kimani Njoroge, modified 8 Months ago.

RE: Use Primefaces commentbox in liferay

New Member Posts: 1 Join Date: 11/6/17 Recent Posts
Hi Marcel,
I have tried the comment box and it has worked on well so far. Recently I added it to p:tabView and it couldn't work since it contains h:form element. To work around this I removed the p:tabView from its h:form parent. After adding it to the second tab, the tab can't load when the p:tabView dynamic attribute is set to true.
[indent]
<p:tabView dynamic="true"/>
[/indent]

No error in server logs but in firefox console there is an error
[indent]

POST XHR http://localhost:8040/CommentBoxDemo-2.0.2/test.xhtml [HTTP/1.1 200 OK 424ms]
ReferenceError: j_idt98_commentboxWrapper is not defined[Learn More] jquery.js.xhtml:1:205
[/indent]

I am working with
  • WildFly 10.1.0 Final
  • have tried mojarra 2.2.13, 2.2.14 and 2.2.15 to no avail
  • PrimeFaces 6.1