Creating a Liferay portlet configuration page

Dropout

I'm trying to create a configuration page for a Liferay portlet, so I can set some parameters for it. For example I would like to choose what page should a controller display when viewing it. The configuration should be located here:

enter image description here

So I've created a controller for the config like this:

import com.liferay.portal.kernel.portlet.ConfigurationAction;
import javax.portlet.*;

public class SandboxPortletConfig implements ConfigurationAction {
@Override
public void processAction(PortletConfig portletConfig, 
    ActionRequest actionRequest, ActionResponse actionResponse) 
        throws Exception {

    }

@Override
public String render(PortletConfig portletConfig, RenderRequest renderRequest, 
    RenderResponse renderResponse) throws Exception {
    return "/sandboxPortlet/config";
    }
}

A JSP page for the view part:

<%@ page pageEncoding="UTF-8"%>
<%@ include file="../init.jsp"%>

<form>
    Select:
    <select>
        <option>1</option>
        <option>2</option>
        <option>3</option>
    </select>
</form>

I've set up my portlet.xml to include:

<portlet>
    <portlet-name>sandboxPortlet</portlet-name>
    <display-name>Sandbox Portlet</display-name>
    <portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
    <init-param>
        <name>contextConfigLocation</name>
        <value>/WEB-INF/spring/sandbox-portlet-context.xml</value>
    </init-param>
    <init-param>
        <name>config-jsp</name>
        <value>/WEB-INF/html/sandboxPortlet/config.jsp</value>
    </init-param>
    <supports>
        <mime-type>text/html</mime-type>
        <portlet-mode>view</portlet-mode>
        <portlet-mode>edit</portlet-mode>
    </supports>
    <portlet-info>
        <title>Sandbox Portlet</title>
        <short-title>Sandbox</short-title>
        <keywords>sandbox test testing</keywords>
    </portlet-info>
</portlet>

and my liferay-portlet.xml to be like:

<portlet>
    <portlet-name>sandboxPortlet</portlet-name>
    <instanceable>false</instanceable>
    <configuration-action-class>path.to.the.portlet.sandboxPortlet.SandboxPortletConfig</configuration-action-class>
</portlet>

But I'm unable to see the configuration tab. Is there anything else that I need to configure in order to see the configuration, please?

Pankaj Kathiriya

Instead of return "/sandboxPortlet/config"; provide return "/html/sandboxPortlet/config.jsp";

You have to provide full jsp path.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Creating a Liferay portlet configuration page

From Dev

Liferay: creating a portlet configuration page. How to provide correct jsp path?

From Dev

Liferay portlet configuration

From Dev

Liferay 6.2 search portlet configuration for all pages

From Dev

Liferay portlet rerenders init page after processAction

From Dev

Liferay Vaadin 7 Portlet: Init Method is not Called when Page is Refreshed

From Dev

Liferay portlet with freemarker and spring

From Dev

passing parameters to a liferay portlet

From Dev

How to refresh a liferay portlet?

From Dev

Customizing liferay Calendar portlet

From Dev

Existing project as a portlet in Liferay

From Dev

Customizing liferay Calendar portlet

From Dev

passing parameters to a liferay portlet

From Dev

Liferay Search Portlet Customization

From Dev

Creating liferay portlet - How to pass data to to myScript.js from Java class via view.jsp

From Dev

Inserting a JavaScript resource into a Liferay Portlet

From Dev

Liferay portlet doView() after redirect

From Dev

Ajax not triggered in my Liferay portlet

From Dev

Liferay - Call a controller of a remote portlet

From Dev

How to add time to Liferay portlet

From Dev

Embedding jpg within Liferay Portlet

From Dev

Liferay Portlet-Servlet communication

From Dev

Placing an iframe inside of a Liferay portlet

From Dev

Setting and Getting Portlet ID in Liferay

From Dev

Overloading web content Portlet in Liferay

From Dev

Customizing My Sites portlet in Liferay

From Dev

Modify Liferay's Marketplace portlet

From Dev

Liferay - change portlet column programmatically

From Dev

Liferay Portlet Error - "NoSuchResourceActionException <Portlet>_WAR_<PortletApp>#VIEW"

Related Related

HotTag

Archive