You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TextFieldMaxLengthRemovedFromDOM.java 815B

1234567891011121314151617181920212223242526272829303132
  1. package com.vaadin.tests.components.textfield;
  2. import com.vaadin.tests.components.TestBase;
  3. import com.vaadin.v7.ui.TextField;
  4. public class TextFieldMaxLengthRemovedFromDOM extends TestBase {
  5. @Override
  6. protected void setup() {
  7. final TextField tf = new TextField();
  8. tf.setMaxLength(11);
  9. tf.setRequired(true);
  10. tf.setImmediate(true);
  11. addComponent(tf);
  12. tf.addFocusListener(event -> {
  13. // Resetting Max length should not remove maxlength attribute
  14. tf.setMaxLength(11);
  15. });
  16. }
  17. @Override
  18. protected String getDescription() {
  19. return "Maxlength attribute should not dissappear from the DOM when I focus the text field.";
  20. }
  21. @Override
  22. protected Integer getTicketNumber() {
  23. return 9940;
  24. }
  25. }