Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
kiesa viciius
Liferay Portlet Button
August 30, 2011 5:52 AM

kiesa viciius

Rank: Junior Member

Posts: 28

Join Date: August 22, 2011

Recent Posts

hey ,

How can i add a normal button using Liferay?

I was using VaadinPortlet , in Vaadin you need only few rows :

2    Button Config;
4                HorizontalLayout fittingLayout = new HorizontalLayout();
5                Config = new Button("Config");
6                Config.addListener(this);
7                fittingLayout.addComponent(Config);

I'd like to add 3-4 buttons in HorizontalLayout in liferayportlet any suggestions?

 1package com.test;
 5import javax.portlet.PortletException;
 6import javax.portlet.RenderRequest;
 7import javax.portlet.RenderResponse;
 8import com.liferay.util.bridges.mvc.MVCPortlet;
11 * Portlet implementation class NewPortlet
12 */
13public class KiviatPortlet extends MVCPortlet  {
17      public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
18      {
19      }

however it does not seem to work in liferay portlet

Any help is greatly Appreciated
David H Nebinger
RE: Liferay Portlet Button
August 30, 2011 6:19 AM

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 13222

Join Date: September 1, 2006

Recent Posts

Vaadin is a different beast than the standard MVC portlet...

Using MVC, you'll create a JSP page that has a number of <input type="button" /> tags (with appropriate IDs and other attributes) to trigger things in your portlet code.

Vaadin, of course, is much easier because you're doing all of your button additions and event handling right in the java code.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!