<portlet:renderURL var="reportURL">
<portlet:param name="jspPage" value="/htmlreport/report.html" />
</portlet:renderURL>
上面是我的渲染portlet url。我的问题是如何动态更改value =“/ htmlreport / report.html”?
有什么办法吗?
createRenderURL() { alert("hiiii"); AUI().ready('liferay-portlet-url', function(A) { alert("hiiii"); var renderURL = Liferay.PortletURL.createRenderURL(); renderURL .setParameter("jspPage","/htmlreport/report.html"); renderURL .setPortletId("eMenuAdvertise_WAR_eMenuAdvertiseportlet"); alert(renderURL.toString()); $("#mydiv").load(renderURL.toString()); alert(""); }); }
答案 0 :(得分:4)
您可以使用liferay javascript函数生成renderUrl,如下所示:
AUI().use("liferay-portlet-url", function(a) {
var portletURL = Liferay.PortletURL.createRenderURL();
var value = document.getElementById('page');
portletURL.setParameter("jspPage", value);
});