Forums

Home » Liferay Portal » English » 3. Development

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

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 :

1
2    Button Config;
3
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;
 2
 3import java.io.IOException;
 4
 5import javax.portlet.PortletException;
 6import javax.portlet.RenderRequest;
 7import javax.portlet.RenderResponse;
 8import com.liferay.util.bridges.mvc.MVCPortlet;
 9
10/**
11 * Portlet implementation class NewPortlet
12 */
13public class KiviatPortlet extends MVCPortlet  {
14   
15
16
17      public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
18      {
19      }
20}


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
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8975

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.