Forums de discussion

Page Navigation from a Portlet

thumbnail
Jubril Oyesiji, modifié il y a 11 années.

Page Navigation from a Portlet

Junior Member Publications: 35 Date d'inscription: 09/02/12 Publications récentes
Hello,
I want to be able to navigate from my JSF portlet, When the user clicks submit the Liferay portal should change to another page, Please how can i accomplish this
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Page Navigation from a Portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Do you mean:

1) Navigate from one JSF view to another within the same portlet on the same portal page?

2) Navigate from one portal page (that contains a JSF portlet) to an entirely different portal Page?
thumbnail
Jubril Oyesiji, modifié il y a 11 années.

RE: Page Navigation from a Portlet

Junior Member Publications: 35 Date d'inscription: 09/02/12 Publications récentes
I meant
2) Navigate from one portal page (that contains a JSF portlet) to an entirely different portal Page?
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Page Navigation from a Portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
If you include the liferay-faces-portal dependency in your portlet WAR, thenyou could do something like this:

<h:outputlink value="#{liferay.portalURL}/web/guest/someotherpage" />
thumbnail
Jubril Oyesiji, modifié il y a 11 années.

RE: Page Navigation from a Portlet

Junior Member Publications: 35 Date d'inscription: 09/02/12 Publications récentes
Neil Griffin:
If you include the liferay-faces-portal dependency in your portlet WAR, thenyou could do something like this:

<h:outputlink value="#{liferay.portalURL}/web/guest/someotherpage" />

Thanks but
Navigation will be from a Managed Bean
a <h:commandButton> invokes a method and depending on the results from that method goes to another page
Benjamin Fischer, modifié il y a 11 années.

RE: Page Navigation from a Portlet

New Member Publications: 9 Date d'inscription: 14/05/12 Publications récentes
Hello Jubril

try the following in your Action:
		FacesContext facesContext = getCurrentInstance();
		ExternalContext externalContext = facesContext.getExternalContext();
		externalContext.redirect("/some/url");
thumbnail
Jubril Oyesiji, modifié il y a 11 années.

RE: Page Navigation from a Portlet

Junior Member Publications: 35 Date d'inscription: 09/02/12 Publications récentes
That worked


Thanks
Benjamin Fischer, modifié il y a 11 années.

RE: Page Navigation from a Portlet

New Member Publications: 9 Date d'inscription: 14/05/12 Publications récentes
Im glad to hear that emoticon
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Page Navigation from a Portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Thanks Benjamin!

Just wanted to mention that I did some research, and it turns out that this is not possible to do this with a to-view-id in a WEB-INF/faces-config.xml navigation-rule because the JSF implementation (Mojarra/MyFaces) will not allow any type of absolute URL (like a URL starting with "http://" ). As the element name to-view-id suggests, it MUST be a JSF view.
Sohi Mankotia, modifié il y a 11 années.

RE: Page Navigation from a Portlet

New Member Publications: 13 Date d'inscription: 06/07/12 Publications récentes
hi i am using jsp spring and liferay. i want to navigate to a new kliferay page from a link in jsp page through a action method in spring..how to do that??
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Page Navigation from a Portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Are you using JSP as a view technology for JSF? Or plain old JSP without JSF?
Timur Magzumov, modifié il y a 10 années.

RE: Page Navigation from a Portlet

New Member Publications: 3 Date d'inscription: 12/04/13 Publications récentes
Hi,
I am trying to navigate to different portal page by clicking button in a custom portlet.
Can you provide any feedback or comments on how to do it?
I mean portlet code snippets, or references to sources with description.

Thanks a lot emoticon
thumbnail
Vernon Singleton, modifié il y a 10 années.

RE: Page Navigation from a Portlet

Expert Publications: 315 Date d'inscription: 14/01/13 Publications récentes
Hi Timur,

You could try downloading some of the demos here:
http://www.liferay.com/community/liferay-projects/liferay-faces/demos

and try them out.

You might want to also try the latest snapshots of these demos from here:
https://oss.sonatype.org/content/repositories/snapshots/com/liferay/faces/demos/

There are many examples in the demos of how set up navigation to portal pages.
You can also browse through code snippets of the portlets in the demos here on github:
https://github.com/liferay/liferay-faces/tree/master/demos/bridge

If you want to dive in you can build your own demos:
http://www.liferay.com/community/wiki/-/wiki/Main/Building+Liferay+Faces+From+Source

Hope that helps,
Vernon
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Page Navigation from a Portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Timur Magzumov:
I am trying to navigate to different portal page by clicking button in a custom portlet.


You might be able to use a simple HTML button like this:

<input type="button" onclick="document.location.href='/otherportalpage';">