Friday, July 10, 2009

Playing with portletURL in Liferay

With out tld :
============================================================================================
1.To get currentURL :
PortletURL url = PortletURLUtil.getCurrent(renderRequest, mimeResponse or renderResponse)
============================================================================================

============================================================================================
2.To make clone of a URL :
PortletURL url = PortletURLUtil.clone(portletURL, mimeResponse or renderResponse)
============================================================================================

=============================================================================================
3.creating PortletURL from actionResponse :
PortletURL renderURL = ((ActionResponseImpl) actionResponse).createRenderURL();
===============================================================================================================

============================================================================================================
4.creating PortletURL from renderResponse :
a.For RenderURL:
PortletURL renderURL = renderResponse.createRenderURL();
b.For actionURL:
PortletURL actionURL = renderResponse.createActionURL();
============================================================================================================

5.Using TLD's in Liferay :
a.

<portlet:renderURL windowState="<%= WindowState.ur_state.toString() %>">
<portlet:param name="param_name" value="param_value" />
<portlet:param name="param_name" value="param_value" />
</portlet:renderURL>

b.
<portlet:actionURL windowState="<%= WindowState.ur_state.toString() %>">
<portlet:param name="param_name" value="param_value" />
<portlet:param name="param_name" value="param_value" />
</portlet:actionURL>

4 comments:

faris said...

Mr.Kamal its great information you have provided. Hope you will post more regarding Liferay.

Anonymous said...

f

Panumat said...

Thank you for great information.

vijay said...

can u add #top in url