Package com.vaadin.tests.components.textfield

Source Code of com.vaadin.tests.components.textfield.TextFieldMaxLengthRemovedFromDOM

package com.vaadin.tests.components.textfield;

import com.vaadin.event.FieldEvents;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.TextField;

public class TextFieldMaxLengthRemovedFromDOM extends TestBase {

    @Override
    protected void setup() {
        final TextField tf = new TextField();
        tf.setMaxLength(11);
        tf.setRequired(true);
        tf.setImmediate(true);
        addComponent(tf);

        tf.addFocusListener(new FieldEvents.FocusListener() {

            @Override
            public void focus(FocusEvent event) {
                // Resetting Max length should not remove maxlength attribute
                tf.setMaxLength(11);
            }
        });
    }

    @Override
    protected String getDescription() {
        return "Maxlength attribute should not dissappear from the DOM when I focus the text field.";
    }

    @Override
    protected Integer getTicketNumber() {
        return 9940;
    }

}
TOP

Related Classes of com.vaadin.tests.components.textfield.TextFieldMaxLengthRemovedFromDOM

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.