Foren

RE: Links in JSF portlet

thumbnail
Jitender Dhiman, geändert vor 11 Jahren.

Links in JSF portlet

Junior Member Beiträge: 29 Beitrittsdatum: 21.09.12 Neueste Beiträge
Hi, I am new to liferay ..

I want to create link of other page in my JSF portlet.
I am using :

<portlet:renderURL var="kpage">
<portlet:param name="hm" value="/kpage.xhtml" />
</portlet:renderURL>

<h:outputLink value="#{kpage}">s</h:outputLink>


But it does not works..

both pages are in views folder.
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: Links in JSF portlet

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Do you want to simply navigate to a different JSF view in the same portlet? If so then you can do something like this:

<h:commandbutton action="/kpage.xhtml" value="Click Me" />


The usage of portlet:renderURL would be more appropriate for re-rendering the current portal page.
thumbnail
Jitender Dhiman, geändert vor 11 Jahren.

RE: Links in JSF portlet

Junior Member Beiträge: 29 Beitrittsdatum: 21.09.12 Neueste Beiträge
Thanks Neil.

but for commandlink we have to use form also..

Can we make links without creating form...?
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: Links in JSF portlet

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
The h:commandButton and h:commandLink component tags must be surrounded by h:form in order to work. This is because the JSF lifecycle has to be executed in order to execute the NavigationHandler which transitions to the next viewId.