How to call a Liferay calendar portlet from my own

2019-09-09 20:09发布

问题:

I have a requirement that i have to call the liferay calendar portlet from my portlet.Can anybody give me any idea that how it can be achieved? I am doing this to my view.jsp

<script src="http://localhost:8080/html/js/liferay/widget.js" type="text/javascript"></script>
<script type="text/javascript">
Liferay.Widget({ url: 'http://localhost:8080/widget/web/guest/interview-availibility/-/calendar'});
</script>

but it is not working .Please somebody help

回答1:

There are two options available for adding a portlet into another portlet.

Using liferay-portlet:runtime

<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<liferay-portlet:runtime name="8" instance="xxx" queryString="" />

OR

<liferay-portlet:runtime portletName="_1_WAR_calendarportlet_" />

Using liferay-ui:calendar

<liferay-ui:calendar day="" year="" month="" />

References:
runtime-portlet
liferay-ui