Directory

← Back

TextFieldMultiline Add-on

TextFieldMultiline

Author

Contributors

Rating

A vaadin textfield that turns into a vaadin textarea to give the option to give a multiline string. Each line will be an entry in the value (List).

Sample code

package org.vaadin.addons.demo;

import org.vaadin.addons.TextFieldMulitline;

import java.awt.TextField;

import javax.servlet.annotation.WebServlet;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@Theme("demo")
@Title("TextFieldMultiselect Add-on Demo")
@SuppressWarnings("serial")
public class DemoUI extends UI
{

    @WebServlet(value = "/*", asyncSupported = true)
    @VaadinServletConfiguration(productionMode = false, ui = DemoUI.class, widgetset = "org.vaadin.addons.demo.DemoWidgetSet")
    public static class Servlet extends VaadinServlet {
    }

    @Override
    protected void init(VaadinRequest request) {

        // Initialize our new UI component
        final TextFieldMulitline component = new TextFieldMulitline();
        component.setCaption("Caption");
        component.setInputPrompt("Enter multiline here");

        // Show it in the middle of the screen
        final VerticalLayout layout = new VerticalLayout();
        layout.setStyleName("demoContentLayout");
        layout.setSizeFull();
        layout.addComponent(component);
        layout.setComponentAlignment(component, Alignment.MIDDLE_CENTER);
        setContent(layout);

    }

}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

fixed design bug with setEnabled(false)

Released
2016-08-11
Maturity
BETA
License
MIT License

Compatibility

Framework
Vaadin 7.6+
Vaadin 8.0+ in 2.0
Vaadin 7.0+ in 0.0.12
Browser
Internet Explorer
Internet Explorer
Internet Explorer
Firefox
Opera
Safari
Google Chrome
Internet Explorer
iOS Browser
Internet Explorer
Internet Explorer

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online