David Silva
David Silva

Reputation: 2017

How to refresh a liferay portlet?

I try to create a link refreshing a liferay portlet, but this doesn't work:

<a href="javascript:Liferay.Portlet.refresh('#p_p_id_portletname')">link</a>

What is wrong?

Upvotes: 2

Views: 5286

Answers (1)

Pankaj Kathiriya
Pankaj Kathiriya

Reputation: 4210

You have to add extra _ (underscore) at the end.

e.g. Liferay.Portlet.refresh("#p_p_id_customCharts_WAR_CustomCharts_INSTANCE_6QxU_")

Also, Its good practice to use onclick attribute instead of href for calling javascript.

Upvotes: 3

Related Questions