Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Corentin R
Redirect from a portlet view to another portlet with RenderURL
30 de Abril de 2011 00:02
Resposta

Corentin R

Ranking: Junior Member

Mensagens: 92

Data de entrada: 18 de Junho de 2010

Mensagens recentes

Hi !

I'm new to portlet development but I think I'm missing some important point here emoticon

I would like to redirect from a portletA view (jsp) to another portlet (let's say it name in portlet.xml is portletNameB ).
To do so I tryed to redirect from the view of PortletA to the portletB with a renderURL like this :
1<liferay-portlet:renderURL portletName="portletNameB_WARname" varImpl="redirectURL">
2<liferay-portlet:param name="jspPage" value="/html/pathToJsp.jsp" />
3</liferay-portlet:renderURL>
4<aui:button value="redirectButton" onClick="<%=redirectURL.toString()%>" name="redirectButton" />


If I specify a windowState attribute to Exclusive or Maximize it correctly called the render method from my portletB and after that it displays the view.
Otherwise it will always call the render method from my portletA and displays the default view (my jspPage param seems to be lost)

Is it possible to use Normal Windows state to simply display in my portletA area the view of a portletB ?
Will the actionURL on my portletB view still working and calling actions of the portletB after redirection?

Thanks a lot for your help.
Corentin R
RE: Redirect from a portlet view to another portlet with RenderURL
30 de Abril de 2011 00:01
Resposta

Corentin R

Ranking: Junior Member

Mensagens: 92

Data de entrada: 18 de Junho de 2010

Mensagens recentes

By the way I'm using liferay 6.0.6 and MVCPortlet if that could help...

And if I used
1<liferay-portlet:actionURL name="methodB" portletName="portletNameB_WARname" varImpl="redirectURL">
instead of
1<liferay-portlet:renderURL portletName="portletNameB_WARname" varImpl="redirectURL">
the methodB is called during actionPhase but during RenderPhase it's always the render method from PortletA wich will be called redirecting me to the the default view from portletA emoticon

Please help ...
Mohammed Azam
RE: Redirect from a portlet view to another portlet with RenderURL
2 de Maio de 2011 03:00
Resposta

Mohammed Azam

Ranking: Regular Member

Mensagens: 159

Data de entrada: 6 de Novembro de 2009

Mensagens recentes

Hi Corentin

You can try this Liferayurl to create the renderURL of the second portlet.

1String portletName = "mysearchportlet";
2
3    LiferayPortletURL secondURL = PortletURLFactoryUtil.create(request,
4            portletName, plid, PortletRequest.RENDER_PHASE);


Hope this helps.
Luis Rodríguez Fernández
RE: Redirect from a portlet view to another portlet with RenderURL
2 de Maio de 2011 05:40
Resposta

Luis Rodríguez Fernández

Ranking: Junior Member

Mensagens: 86

Data de entrada: 26 de Junho de 2009

Mensagens recentes

Hi Coretin,

I think that you could try the code that Mohammed has kindly suggested to you.

If it helps for me the <liferay-portlet:actionURL> tag its working. The only difference is that I am using struts2 for developing my portlets. You can take a look to this forum post

Hope it helps,

Luis
Corentin R
RE: Redirect from a portlet view to another portlet with RenderURL
2 de Maio de 2011 09:44
Resposta

Corentin R

Ranking: Junior Member

Mensagens: 92

Data de entrada: 18 de Junho de 2010

Mensagens recentes

Mohammed, Luis thanks for your replies,
I've tryed both of your solutions but unfortunatly the link always get me back to the default view from my portlet without event calling the render method from my portletB...
But if I change the windowState to MAXIMIZED there it works emoticon
By the way Mohammed is it possible to call the PortletURLFactoryUtil.create with a portletName without any WAR reference in it and only the portlet name from portlet.xml?
In this case I supposed the portlet must be in the same WAR as the portlet from which it's called ?
Mohammed Azam
RE: Redirect from a portlet view to another portlet with RenderURL
13 de Maio de 2011 02:34
Resposta

Mohammed Azam

Ranking: Regular Member

Mensagens: 159

Data de entrada: 6 de Novembro de 2009

Mensagens recentes

Hi,

In that case you can try using this code

1
2PortletURL myaccountURL = new PortletURLImpl(request, PortletKeys.MY_ACCOUNT, plid.longValue(), PortletRequest.RENDER_PHASE);
3myaccountURL.setWindowState(WindowState.MAXIMIZED);
4myaccountURL.setParameter("struts_action", "/my_account/view");



I had used this to call myaccount in my portlet
Corentin R
RE: Redirect from a portlet view to another portlet with RenderURL
13 de Maio de 2011 02:44
Resposta

Corentin R

Ranking: Junior Member

Mensagens: 92

Data de entrada: 18 de Junho de 2010

Mensagens recentes

Mohammed Azam:
Hi,

In that case you can try using this code

1
2PortletURL myaccountURL = new PortletURLImpl(request, PortletKeys.MY_ACCOUNT, plid.longValue(), PortletRequest.RENDER_PHASE);
3myaccountURL.setWindowState(WindowState.MAXIMIZED);
4myaccountURL.setParameter("struts_action", "/my_account/view");



I had used this to call myaccount in my portlet


But in this case the portlet will be opened in maximized state...
And that's allready working in this case.
My problem occures when I try to call the view of a portlet B with a Normal WindowState from the view of a portlet A.
At this time I've not found another solution than extending portlet A from portlet B.
romain vergnais
RE: Redirect from a portlet view to another portlet with RenderURL
15 de Junho de 2011 02:36
Resposta

romain vergnais

Ranking: New Member

Mensagens: 1

Data de entrada: 2 de Maio de 2011

Mensagens recentes

Hi,

I encountered the same windowstate problem in normal mode, it only renders in maximized state.

Did anyone found a solution to this issue ?
Thomas Kevin
RE: Redirect from a portlet view to another portlet with RenderURL
15 de Junho de 2011 03:05
Resposta

Thomas Kevin

Ranking: New Member

Mensagens: 9

Data de entrada: 5 de Maio de 2011

Mensagens recentes

Hi please try,

Using JSR286 WebSphere Portal 6.1.

In JSR286 share parameters from a specific portlet to a specific set of other portlets using the setRenderParameter API. In JSR 168, It was only limited for the same portlet (not with others).

Try to use new WebSphere Portal 6.1 ....


Regards
Kevin Thomas
Attune Infocom Inc
Email : contact@attuneinfocom.com
Liferay Portlet
Himanshu Bhandari
RE: Redirect from a portlet view to another portlet with RenderURL
30 de Junho de 2015 00:44
Resposta

Himanshu Bhandari

Ranking: Regular Member

Mensagens: 135

Data de entrada: 8 de Maio de 2014

Mensagens recentes

Hi
(update for visitors of 2015)
as per Liferay 6.2 if I use
1 portletName="portletNameB_WARname"
, I am getting this error
Attribute portletName invalid for tag renderURL according to TLD

Thanks