Fórum

How to remove self(portlet instance) in javascript?

Nav Dhillon, modificado 11 Anos atrás.

How to remove self(portlet instance) in javascript?

New Member Postagens: 24 Data de Entrada: 01/11/11 Postagens Recentes
I have an instanceable portlet. My requirement is to add/delete instances of this portlet which the click of a button in a "controller" portlet. I am able to add instances of portlet using Liferay.Portlet.add(). But I couldn't find anything like Liferay.Portlet.remove(portletId).

Basically, each instance of my portlet will have a "Delete Me" button , whose onClick needs to trigger the deletion/removal of that portlet instance itself. I tried reverse-engineering the delete icon to see how that works, but didn't get very far.

Any pointers? Appreciate it. Thanks

Nav
thumbnail
Priyanka Dhingra, modificado 11 Anos atrás.

RE: How to remove self(portlet instance) in javascript?

Liferay Master Postagens: 501 Data de Entrada: 20/12/11 Postagens Recentes
Hi,
i think the code of nested portlet(OOemoticon may help you..

Moreover, this is the url, being referred on delete:-
href="/c/portal/update_layout?p_l_id=10159&p_p_id=29&doAsUserId=&cmd=delete&referer=%2Fc%2Fportal%2Flayout%3Fp_l_id%3D10159%26doAsUserId%3D&refresh=1"

i dont know, but this should help you somewhere...

Regards
Priyanka
Nav Dhillon, modificado 11 Anos atrás.

RE: How to remove self(portlet instance) in javascript?

New Member Postagens: 24 Data de Entrada: 01/11/11 Postagens Recentes
Thank you Priyanka, this is exactly what I needed. Regards
Patrick Warnecke, modificado 11 Anos atrás.

RE: How to remove self(portlet instance) in javascript?

New Member Postagens: 13 Data de Entrada: 18/09/12 Postagens Recentes
Could you please share your solution? I'm trying to do the same thing and can't figure out how to delete the Portlet.
How do you get the Id of the Portlet if it's an instanced Portlet?
And how do you finally delete it with the link Priyanka Dhingra? Simply an AJAX-Call to that URL?

Thanks in advance!