掲示板

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

thumbnail
14年前 に Rishi Dev Gupta によって更新されました。

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

Expert 投稿: 255 参加年月日: 08/11/23 最新の投稿
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
14年前 に Christianto Sahat によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Regular Member 投稿: 179 参加年月日: 07/09/25 最新の投稿
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
14年前 に Rishi Dev Gupta によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Expert 投稿: 255 参加年月日: 08/11/23 最新の投稿
Thanks Christianto , that was really helpful.
14年前 に Bryan Alvaro Alfaro によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Junior Member 投稿: 28 参加年月日: 08/11/26 最新の投稿
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
14年前 に Sandy K によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

New Member 投稿: 4 参加年月日: 09/07/08 最新の投稿
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
14年前 に Gerhard Horatschek によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Junior Member 投稿: 86 参加年月日: 09/03/20 最新の投稿
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
14年前 に Tarun S. Kayasth によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Regular Member 投稿: 162 参加年月日: 07/06/08 最新の投稿
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
13年前 に Mohammed Azam によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Regular Member 投稿: 159 参加年月日: 09/11/06 最新の投稿
Hi

Check this link hope this gives an idea to refresh only your portlet.
thumbnail
8年前 に Srikanth Shanigaram によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Junior Member 投稿: 55 参加年月日: 14/10/07 最新の投稿
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
8年前 に Jan Geißler によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
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
8年前 に Srikanth Shanigaram によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Junior Member 投稿: 55 参加年月日: 14/10/07 最新の投稿
Thank you but i need to pass other varaibles along with portlet id to refresh with based on passed params
thumbnail
8年前 に Jan Geißler によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
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
8年前 に Srikanth Shanigaram によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Junior Member 投稿: 55 参加年月日: 14/10/07 最新の投稿
Yes, But i dont have idea to do that.
thumbnail
8年前 に Jan Geißler によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

Liferay Master 投稿: 735 参加年月日: 11/07/05 最新の投稿
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.
13年前 に Bostjan Stor によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

New Member 投稿: 1 参加年月日: 11/01/06 最新の投稿
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
13年前 に Abel Morillo によって更新されました。

RE: Refresh only portlet content on Jquery/ajax action

New Member 投稿: 5 参加年月日: 10/04/05 最新の投稿
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);
12年前 に Michele Benson によって更新されました。

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

New Member 投稿: 16 参加年月日: 11/03/23 最新の投稿
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?