Message Boards

Liferay comments not working inside search-container in DXP 7.2

Upender Kashyap, modified 3 Years ago.

Liferay comments not working inside search-container in DXP 7.2

Junior Member Posts: 30 Join Date: 8/12/20 Recent Posts
Hello Everyone,I have a page where I am displaying a list of posts. I want to implement like and comment functionality for each post. Like Api is working well in my case but  comments are not working. I am following the approach given here https://help.liferay.com/hc/en-us/articles/360028726072-Adding-Comments-to-Your-App.
 The code in my jsp is like:
<liferay-ui:ratings className="<%=FormService.class.getName()%>" classPK="<%=aForm.getPrimaryKey()%>" type="like"/>
                <liferay-ui:panel-container extended="<%=false%>" id="formPanelContainer" persistState="<%=true%>">
                         <liferay-ui:panel collapsible="<%=true%>" extended="<%=true%>" id="userCommentsPanel" persistState="<%=true%>" title="comments">
                      
                            <portlet:actionURL name="invokeTaglibDiscussion" var="discussionURL" />
                            <liferay-comment:discussion className="<%=FormService.class.getName()%>"
                                      classPK="<%=aForm.getPrimaryKey()%>"
                                      formAction="<%=discussionURL%>" formName="form2"
                                      ratingsEnabled="<%=true%>" 
                                      redirect="<%= PortalUtil.getCurrentURL(request)%>"
                                      userId="<%=aForm.getUserId()%>" />
                        </liferay-ui:panel>
                </liferay-ui:panel-container>
Here  <portlet:actionURL name="invokeTaglibDiscussion" var="discussionURL" /> may be causing any problem? As invokeTaglibDiscussion  is deprecated in DXP 7.2. Can anyone please suggest any alternative solution to this?
Thanks in advance!!
Upender Kashyap, modified 3 Years ago.

RE: Liferay comments not working for custom portlet in DXP 7.2

Junior Member Posts: 30 Join Date: 8/12/20 Recent Posts
Hi ,
I am using using the discussion tab inside the search container. Can anyone please let me know how it will work. The form is getting submitted on clicking Reply but no comment is being saved. Its showing warning 
Method "invokeTaglibDiscussion" not found.
on my JSP.
Thanks in advance
Upender Kashyap, modified 3 Years ago.

RE: Liferay comments not working inside search-container in DXP 7.2

Junior Member Posts: 30 Join Date: 8/12/20 Recent Posts
Hi,
There seems to some issue in liferay. If I am trying to override invokeTaglibDiscussion in portlet class which is extending MVCPortlet, its giving compile time error. As i checked this method is now deprecated. Can anyone pls give solution for this.
Thanks
Upender Kashyap, modified 3 Years ago.

RE: Liferay comments not working inside search-container in DXP 7.2

Junior Member Posts: 30 Join Date: 8/12/20 Recent Posts
Hi Developers,If anyone faced this issue in Liferay 7.2 please advice how to resolve this.Thanks in Advance!
thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Liferay comments not working inside search-container in DXP 7.2

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi,
Remove the formAction , if you want to use the default action .In case you want to write your own implementation then you can use  formAction. 
 
<liferay-comment:discussion className="<%=FormService.class.getName()%>"           classPK="<%=aForm.getPrimaryKey()%>" formName="form2"  ratingsEnabled="<%=true%>"  redirect="<%= PortalUtil.getCurrentURL(request)%>"  userId="<%=aForm.getUserId()%>" />
Upender Kashyap, modified 3 Years ago.

RE: Liferay comments not working inside search-container in DXP 7.2

Junior Member Posts: 30 Join Date: 8/12/20 Recent Posts
Thanks emoticon