Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jitender Dhiman
Links in JSF portlet
January 24, 2013 1:26 AM
Answer

Jitender Dhiman

Rank: Junior Member

Posts: 29

Join Date: September 21, 2012

Recent Posts

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.
Neil Griffin
RE: Links in JSF portlet
January 24, 2013 2:40 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2511

Join Date: July 26, 2005

Recent Posts

Do you want to simply navigate to a different JSF view in the same portlet? If so then you can do something like this:

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


The usage of portlet:renderURL would be more appropriate for re-rendering the current portal page.
Jitender Dhiman
RE: Links in JSF portlet
January 24, 2013 10:18 PM
Answer

Jitender Dhiman

Rank: Junior Member

Posts: 29

Join Date: September 21, 2012

Recent Posts

Thanks Neil.

but for commandlink we have to use form also..

Can we make links without creating form...?
Neil Griffin
RE: Links in JSF portlet
January 29, 2013 1:01 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2511

Join Date: July 26, 2005

Recent Posts

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.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!