Forums de discussion
Refresh asset publisher
Soukaina HAJI, modifié il y a 9 années.
Refresh asset publisher
Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
Hello,
I need to refresh the asset publisher every 2minutes instead of refreshing the page every time ..
Liferay-version : liferay-portal-6.2-ce-ga2
Tomcat : tomcat-7.0.42
thank you
I need to refresh the asset publisher every 2minutes instead of refreshing the page every time ..
Liferay-version : liferay-portal-6.2-ce-ga2
Tomcat : tomcat-7.0.42
thank you
Pankaj Kathiriya, modifié il y a 9 années.
RE: Refresh asset publisher (Réponse)
Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
Using setInterval javascript method and Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>"), you can achieve that.
For Example:
function refreshPortlet(){
Liferay.Portlet.refresh("#p_p_id_19_");
setInterval(refreshPortlet, 10000);
}
refreshPortlet();
above code will refresh Message board portlet every 10 seconds.
Hope this will help.
For Example:
function refreshPortlet(){
Liferay.Portlet.refresh("#p_p_id_19_");
setInterval(refreshPortlet, 10000);
}
refreshPortlet();
above code will refresh Message board portlet every 10 seconds.
Hope this will help.
Soukaina HAJI, modifié il y a 9 années.
RE: Refresh asset publisher
Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
Ok thank you, but where should I put this function ?
Pankaj Kathiriya, modifié il y a 9 années.
RE: Refresh asset publisher
Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
There are many options available to you.
You may add this javascript to page-level, under Site Pages > Edit page > add javascript to Javascript tab.
Or you may add javascript in theme component.
You have to check for feasibility of it.
You may add this javascript to page-level, under Site Pages > Edit page > add javascript to Javascript tab.
Or you may add javascript in theme component.
You have to check for feasibility of it.
Soukaina HAJI, modifié il y a 9 années.
RE: Refresh asset publisher
Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
I put it in the java script field but still not working !
Pankaj Kathiriya, modifié il y a 9 années.
RE: Refresh asset publisher
Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
You can place js code in jsp of asset-publisher-portlet by overriding it with hook.
Soukaina HAJI, modifié il y a 9 années.
RE: Refresh asset publisher
Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
Step1 : Go to "Admin" > "site administration" > "Private pages" >
Step1 2 : Insert the following script in Javascript" in the right side:
Step1 2 : Insert the following script in Javascript" in the right side:
function refreshPortlet(){
Liferay.Portlet.refresh('.portlet-asset-publisher');
setInterval(refreshPortlet, 300000);
}
refreshPortlet();