Fórumok
When will tag liferay-portlet:renderURLParams be needed?
Kurt Xu, módosítva 11 év-val korábban
When will tag liferay-portlet:renderURLParams be needed?
Junior Member Bejegyzések: 57 Csatlakozás dátuma: 2013.02.02. Legújabb bejegyzések
Hi all:
I'm new to liferay development. I discover that submitting form won't make page move without a liferay-portlet:renderURLParams inside the form when I want to search something by the keywords input. What use is liferay-portlet:renderURLParams?
Related code snippet is as below:
It's from sample code Slogan contest portlet from Liferay In Action.
Thanks.
I'm new to liferay development. I discover that submitting form won't make page move without a liferay-portlet:renderURLParams inside the form when I want to search something by the keywords input. What use is liferay-portlet:renderURLParams?
Related code snippet is as below:
<portlet:renderurl var="addSloganURL">
<portlet:param name="jspPage" value="/html/edit_slogan.jsp" />
</portlet:renderurl>
<c:if test="<%= PortletPermissionUtil.contains(permissionChecker, portletDisplay.getId(), "ADD_SLOGAN") %>">
<input type="button" value="<liferay-ui:message key=" add-slogan">" onClick="location.href =
'<%= addSloganURL.toString() %>';" />
</c:if>
<%
String tabs1 = ParamUtil.getString(request, "tabs1", "by-rating");
String tabs1Values = "by-rating,by-date";
PortletURL tabsURL = renderResponse.createRenderURL();
tabsURL.setParameter("jspPage", "/html/view.jsp");
tabsURL.setParameter("tabs1", tabs1);
PortletURL iteratorURL = renderResponse.createRenderURL();
iteratorURL.setParameter("tabs1", tabs1);
%>
<liferay-portlet:renderurl varimpl="searchURL">
<portlet:param name="jspPage" value="/html/search.jsp" />
</liferay-portlet:renderurl>
<aui:form action="<%= searchURL %>" method="get" name="fm0">
<liferay-portlet:renderurlparams varImpl="searchURL" />
<aui:input name="redirect" type="hidden" value="<%= currentURL %>" />
<aui:input name="groupId" type="hidden" value="<%= String.valueOf(scopeGroupId) %>" />
<div class="portlet-toolbar search-form">
<span class="aui-search-bar">
<aui:input inlineField="<%= true %>" label="" name="keywords" size="30" title="search-entries" type="text" />
<aui:button type="submit" value="search" />
</span>
</div>
</aui:form>
It's from sample code Slogan contest portlet from Liferay In Action.
Thanks.