Liferay ist zum sechsten Mal in Folge ein Leader im Gartner Magic Quadrant. Hier mehr erfahren


Home » Liferay Portal » English » 3. Development

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

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 :

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

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 10341

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.