Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • setting portlet preferences from portlet controller in liferay

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 691
    Comment on it

    Hello Guys

    Portlet preferences is use for layout setup in liferay. Here, We have setup layout from controller of the custom portlet in liferay.

    Follow the below steps to setup layout:

    Step 1: add below lines in Liferay-portlet.xml


    Step 2: portlet.xml setting:


    Step 3 : put below code in controller

    public PortletPreferences getStrictLayoutPortletSetup(Layout layout, String portletId) {
        long ownerId = PortletKeys.PREFS_OWNER_ID_DEFAULT;
        int ownerType = PortletKeys.PREFS_OWNER_TYPE_LAYOUT;
        if (PortletConstants.hasUserId(portletId)) {
            ownerId = PortletConstants.getUserId(portletId);
            ownerType = PortletKeys.PREFS_OWNER_TYPE_USER;

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: