Fórumok

Refresh only portlet content on Jquery/ajax action[Resolved]

thumbnail
Rishi Dev Gupta, módosítva 14 év-val korábban

Refresh only portlet content on Jquery/ajax action[Resolved]

Expert Bejegyzések: 255 Csatlakozás dátuma: 2008.11.23. Legújabb bejegyzések
Hi all

I am facing an issue with portlet refresh.
I have a portlet that lists the records and with each record their is a delete button at the end. So when a user clicks on delete button, the record is to be deleted (which I have done through ajax call in jQuery) and the content of portlet needs to be refreshed so that the deleted record is available no more. I don not want to refresh the page as it reloads all the portlets on it.

So anybody have faced the same situation to refresh one portlet content on click and not the whole page.

using LFR 5.2.1

Thanks & Regards
thumbnail
Christianto Sahat, módosítva 14 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Regular Member Bejegyzések: 179 Csatlakozás dátuma: 2007.09.25. Legújabb bejegyzések
Your portlet has to be ajaxable portlet.

Set <render-weight> to 0 and <ajaxable> true on your liferay-portlet.xml.

This will enable 'refresh' icon on your portlet. Check which javascript that's called whenever this refresh is called.

You can implement the same script for your refresh button.
thumbnail
Rishi Dev Gupta, módosítva 14 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Expert Bejegyzések: 255 Csatlakozás dátuma: 2008.11.23. Legújabb bejegyzések
Thanks Christianto , that was really helpful.
Bryan Alvaro Alfaro, módosítva 14 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Junior Member Bejegyzések: 28 Csatlakozás dátuma: 2008.11.26. Legújabb bejegyzések
Hi Rishi,
right now i'm facing the same problem, i'm trying to refresh portlet content via javascript but the refresh icon button has this href="javascript: ;" and it doesn't render anything when i call it via a document.location.replace(url).
How did you solved this issue?
THanks
Sandy K, módosítva 14 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

New Member Bejegyzések: 4 Csatlakozás dátuma: 2009.07.08. Legújabb bejegyzések
Is Ajax is working with Latest Liferay 5.2.3?

As my add(new AjaxEventBehavior("onchange") is not working. Any advice will be of great help. Is I need to chnage any configuration?
thumbnail
Gerhard Horatschek, módosítva 14 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Junior Member Bejegyzések: 86 Csatlakozás dátuma: 2009.03.20. Legújabb bejegyzések
Hi,
I have a similar problem regarding automatic refreshing of a portlet. I need to have funtionality to update the whole portlet triggered by an event. Therefore I have an javascript method in a jsp. Which code I have to add for an update of the portlet? How can I implement this?
Please can you help me?
Thank you,
Regards, Gerhard
thumbnail
Tarun S. Kayasth, módosítva 14 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Regular Member Bejegyzések: 162 Csatlakozás dátuma: 2007.06.08. Legújabb bejegyzések
Hi Gerhard,

I am looking for same type of functionality.
Did you get any luck?

I want to submit one form in my portlet but i don't want entire portal to be refreshed. It should just refresh my portlet.

Thanks,
Tarun
thumbnail
Mohammed Azam, módosítva 13 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Regular Member Bejegyzések: 159 Csatlakozás dátuma: 2009.11.06. Legújabb bejegyzések
Hi

Check this link hope this gives an idea to refresh only your portlet.
thumbnail
Srikanth Shanigaram, módosítva 8 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2014.10.07. Legújabb bejegyzések
Hi

I am able to refresh portlet through javascript as you said but can we pass parameters to this Liferay.portlet.refresh function.
Is it possible?

Thanks in advance.
thumbnail
Jan Geißler, módosítva 8 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Liferay Master Bejegyzések: 735 Csatlakozás dátuma: 2011.07.05. Legújabb bejegyzések
Just a little hint here:
The odds that somebody who posted a question 4 years ago, and is still watching an old thread and also remembers what he did back then are at nearly 0% ;)
That said:
Liferay.Portlet.refresh("#p_p_id_YOUR_PORTLET_ID")
you can pass the portlet ID as a parameter.
thumbnail
Srikanth Shanigaram, módosítva 8 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2014.10.07. Legújabb bejegyzések
Thank you but i need to pass other varaibles along with portlet id to refresh with based on passed params
thumbnail
Jan Geißler, módosítva 8 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Liferay Master Bejegyzések: 735 Csatlakozás dátuma: 2011.07.05. Legújabb bejegyzések
So this will not work, as the method does only have one Argument. But I think you want to do the following:
Refresh the portlet, when somewhere else in the Portal an Action is performed. Is that right?
thumbnail
Srikanth Shanigaram, módosítva 8 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2014.10.07. Legújabb bejegyzések
Yes, But i dont have idea to do that.
thumbnail
Jan Geißler, módosítva 8 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

Liferay Master Bejegyzések: 735 Csatlakozás dátuma: 2011.07.05. Legújabb bejegyzések
Do some research on Inter Portlet Communication and Public Render Parameters. Those are approaches you might want to consider. The Public Render Parameter will not refresh only one portlet though.
Bostjan Stor, módosítva 13 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

New Member Bejegyzés: 1 Csatlakozás dátuma: 2011.01.06. Legújabb bejegyzések
Hi,

I have a question about refreshing portlets.
My portlet displays data from mysql database which is changing rapidly. So I would like to refresh my portlet every 10 seconds.

I already added lines

<render-weight>0</render-weight>
<ajaxable>true</ajaxable>

to liferay-portlet.xml. (I got a refresh button)

I already tried to refresh it with jQuery

$("#portlet_id").load(link."#portlet_id");

inside this function

setTimeout("the_function_above",10000);

but it didn't work.

I also tried to copy and modify refresh function from webapps/ROOT/js/liferay/portlet.js but it didn't work.

Is there a solution?

Thanks,

Best regards
Abel Morillo, módosítva 13 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action

New Member Bejegyzések: 5 Csatlakozás dátuma: 2010.04.05. Legújabb bejegyzések
Programaticamente se puede hacer así:


String urlRefresh = "..." // construimos la url destino del botón refresh
ThemeDisplay theme = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
theme.getPortletDisplay().setShowRefreshIcon(true);
theme.getPortletDisplay().setURLRefresh(urlRefresh);
Michele Benson, módosítva 12 év-val korábban

RE: Refresh only portlet content on Jquery/ajax action[Resolved]

New Member Bejegyzések: 16 Csatlakozás dátuma: 2011.03.23. Legújabb bejegyzések
Rishi Dev Gupta:
Hi all

I am facing an issue with portlet refresh.
I have a portlet that lists the records and with each record their is a delete button at the end. So when a user clicks on delete button, the record is to be deleted (which I have done through ajax call in jQuery) and the content of portlet needs to be refreshed so that the deleted record is available no more. I don not want to refresh the page as it reloads all the portlets on it.

So anybody have faced the same situation to refresh one portlet content on click and not the whole page.

using LFR 5.2.1

Thanks & Regards


I've got the same problem.. but i can't resolve it adding only ajaxable and render weight...
Someone can help me?