RE: Use of Private Messenger in JSF portlet

Zarina Omurova, modified 6 Years ago. New Member Posts: 8 Join Date: 11/23/17 Recent Posts
Hi all,

i have a question having relevance to private messenger app feature from liferay in combination with  customJSF Portlet. Are there any options to call a popup on button click from JSF Portlet and see the same popup window which appears by standard liferay contacts portlet, when you click on "message" button in contact portlet, please see attached file? Using Liferay 7, JSF Portlet  (com.liferay.faces -5.0.3, primefaces). I have commandButton inside my .xhtml file and i want to call popup window  which triggers  that popup from new_message. jsp of private messenger app. Here is the link to the standard contact portlet lines in jsp file where it's used https://github.com/liferay/com-liferay-contacts/blob/master/contacts-web/src/main/resources/META-INF/resources/user/user_toolbar.jsp Lines 178-211.  Has anyone had smth similar to do in their experience? 

Appreciate any help.

Thank you,
​​​​​​​Zarina
thumbnail
Neil Griffin, modified 6 Years ago. Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
Hi Zarina,
I recommend that you take a look at the portal:runtime JSF component provided by the Liferay Faces Portal dependency. It provides the ability to embed a non-JSF portlet within a JSF portlet view.
Kind Regards,
Neil
Zarina Omurova, modified 6 Years ago. New Member Posts: 8 Join Date: 11/23/17 Recent Posts
Hi Neil,

​​​​​​​thank you for your time and suggestion, is it possible to use it only for that popup window, because i don't need to embed the whole private messenger app in jsf?

Thank you,
Zarina
thumbnail
Neil Griffin, modified 6 Years ago. Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
Yes, you can use it only for the popup window. Do you want it to be a popup within the current page (for example, like a PrimeFaces p:dialog) or a detatched window / browser tab? If using something like p:dialog then you can simply use the portal:runtime component tag I mentioned earlier. If using a detached window / browser tab then the URL of the window must be a portlet RenderURL that targets the standard contact portlet. You can use the PortletURLFactoryUtil API to create a RenderURL for any portlet deployed within the system.
Zarina Omurova, modified 6 Years ago. New Member Posts: 8 Join Date: 11/23/17 Recent Posts
I am using just simple modal p:dialog, no need for detached window. I just can't understand how do i call exactly that jsp from contact portlet which is shown after button click on msg? Because if i embedd the whole portlet it will show the whole contact portlet? I've tried to test it and called on button click a p:dialog with following call to privat messaging app as test 


..here call on button click
...<p:dialog ..><h:form>
<portal:runtimeportletName="...social_privatemessaging_web_portlet_PrivateMessagingPortlet" />
</h:form>
</p:dialog>
but its not showing any embedded portlet, not what i need, but wanted to check as a test.
thumbnail
Neil Griffin, modified 6 Years ago. Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
Hi Zarina, are you including the com.liferay.faces.portal.jar dependency in your WAR?
Zarina Omurova, modified 6 Years ago. New Member Posts: 8 Join Date: 11/23/17 Recent Posts
Hi Neil, yes I do have the dependencies included.
Regards,Zarina
thumbnail
Neil Griffin, modified 6 Years ago. Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
OK, please paste the exact usage of portal:runtime -- the example you gave had a "..."
<portal:runtime portletName="...social_privatemessaging_web_portlet_PrivateMessagingPortlet" />
Zarina Omurova, modified 6 Years ago. New Member Posts: 8 Join Date: 11/23/17 Recent Posts
Hi Neil, here is the usage:
​​​​​​​<p:dialog id="test" widgetVar="test" modal="true" resizable="true" >
            <h:form>
            <portal:runtime portletName="com_liferay_social_privatemessaging_web_portlet_PrivateMessagingPortlet"/>
            </h:form>
</p:dialog>
Zarina Omurova, modified 6 Years ago. New Member Posts: 8 Join Date: 11/23/17 Recent Posts
Hi Neil,
am taking another path to impl. this and not using portlet:runtime, but appreciate your help and time.

Thank you,Zarina