Fórum

RE: refresh portlet, not the page

Christian Perez, modificado 10 Anos atrás.

refresh portlet, not the page

Junior Member Postagens: 36 Data de Entrada: 01/07/13 Postagens Recentes
Hi
I work modifying a portlet, and this portlet execute some methods but is very slow then when refresh the page takes much time to refresh, I want to refresh only the portlet and show a progress bar or something like that until the execution is done, and after this reload the portlet every 15 minutes, but only the portlet, not the entire page some idea?
I know that I have to use Ajax, but how to refresh only the portlet? any idea??
thanks
--Chris--
venka reddy, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Regular Member Postagens: 231 Data de Entrada: 23/03/11 Postagens Recentes
hi,

You can refresh your portlet in script

follow the link "http://liferaytutorial.blogspot.in/2013/08/refreshing-portlet-through-javascript.html" .



Let me know anything required further!!
Christian Perez, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Junior Member Postagens: 36 Data de Entrada: 01/07/13 Postagens Recentes
thanks for your reply,
I have a doubt the bold word is the portlet name or the portlet id?
venka reddy, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Regular Member Postagens: 231 Data de Entrada: 23/03/11 Postagens Recentes
Hi,

It is portletId

To get rid of confusion ,

http://localhost:8080/community/forums?p_p_id=test_WAR_test&p_p_lifecycle=0&p_p_state=normal&
p_p_mode=view&p_p_col_id=column-2 &p_p_col_pos=2 & p_p_col_count=3

Here p_p_id refers that name

(or )

Go to the Portlet table , refer portletId column.

Any thing else required?
Christian Perez, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Junior Member Postagens: 36 Data de Entrada: 01/07/13 Postagens Recentes
and one more to set the time to refresh??
venka reddy, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Regular Member Postagens: 231 Data de Entrada: 23/03/11 Postagens Recentes
May this following URL useful

http://stackoverflow.com/questions/2595005/automatic-reload-of-div-container
Christian Perez, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Junior Member Postagens: 36 Data de Entrada: 01/07/13 Postagens Recentes
thanks this was really useful,
but other of my problem is when refresh the page I want to ignore the refresh page and only refresh with the specification of the script, every certain minutes
venka reddy, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Regular Member Postagens: 231 Data de Entrada: 23/03/11 Postagens Recentes
Just done google search found following script

<html>
<body>

<p>Click the button to wait 3 seconds, then alert "Hello".</p>
<p>After clicking away the alert box, an new alert box will appear in 3 seconds. This goes on forever...</p>
<button onclick="myFunction()">Try it</button>

<script>
function myFunction()
{
setInterval(function(){alert("Hello")},3000);
}
</script>


</body>
</html>
Christian Perez, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Junior Member Postagens: 36 Data de Entrada: 01/07/13 Postagens Recentes
thanks
you really help me
venka reddy, modificado 10 Anos atrás.

RE: refresh portlet, not the page

Regular Member Postagens: 231 Data de Entrada: 23/03/11 Postagens Recentes
Sounds good ... emoticon

your welcome