Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
kiesa viciius
Liferay Portlet Button
30. August 2011 05:52
Antwort

kiesa viciius

Rang: Junior Member

Nachrichten: 28

Eintrittsdatum: 22. August 2011

Neue Beiträge

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
30. August 2011 06:19
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 7919

Eintrittsdatum: 1. September 2006

Neue Beiträge

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.