简体   繁体   English

如何刷新Liferay Portlet?

[英]How to refresh a liferay portlet?

I try to create a link refreshing a liferay portlet, but this doesn't work: 我尝试创建一个刷新liferay portlet的链接,但这不起作用:

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

What is wrong? 怎么了?

You have to add extra _ (underscore) at the end. 您必须在末尾添加额外的_(下划线)。

eg Liferay.Portlet.refresh("#p_p_id_customCharts_WAR_CustomCharts_INSTANCE_6QxU_") 例如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. 同样,使用onclick属性而不是href来调用javascript是一种很好的做法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM