Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8936865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:18:30+00:00 2026-06-15T10:18:30+00:00

When an instance of my portlet is going to be removed from a page,

  • 0

When an instance of my portlet is going to be removed from a page, I want to capture that event to get some preference values from that portlet, and to do something.

Is there anything like interfaces or hooks to do that in Liferay?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:18:31+00:00Added an answer on June 15, 2026 at 10:18 am

    You can define your own PortletLayoutListener in liferay-portlet.xml:

    <portlet>
            <portlet-name>xxyyzz</portlet-name>
    ...
            <portlet-layout-listener-class>com.myCompany.MyLayoutTypePortletListener</portlet-layout-listener-class>
    ...
    </portlet>
    

    And your MyLayoutTypePortletListener may be similar to:

    public class MyLayoutTypePortletListener
        implements PortletLayoutListener {
    
        public void onRemoveFromLayout(String portletId, long plid)
            throws PortletLayoutListenerException {
            // ***** ... your LOGIC HERE *****
        }
    
        public void onMoveInLayout(String portletId, long plid)
            throws PortletLayoutListenerException {
    
        }
    
        public void onAddToLayout(String portletId, long plid)
            throws PortletLayoutListenerException {
        }
    
    }
    

    See the journal content portlet for an example and that Liferay’s Forum Post.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For instance... if i have a method that performs some asynchronous operation and i
For instance, copying a configuration section from a web page and then pasting it
I want to extend the users admin portlet that is located in the control
For instance, i have a list like ['a','b','c','d','e']. I want to do something like
For instance: I have a swf, lets say A, that loads another swf, B.
For instance, the app could say something like, Please wait. or I'll be right
Is there any way to get 2 instances of an instanceable portlet with different
I want to make spring MVC 3.0.3 portlet using DispatcherPortlet class With JSON support.
For instance, I have a model class which handles receiving bluetooth messages from other
for instance a very simple method: private int GetCount(ITable table) { return (from T

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.