Package com.vaadin.ui

Examples of com.vaadin.ui.TextField.addListener()


    private TextField createIntegerTextField() {
        final TextField tf = new TextField("Enter an integer");
        tf.setConverter(Integer.class);
        tf.setImmediate(true);
        tf.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                try {
                    log.log("Value for " + tf.getCaption() + " changed to "
View Full Code Here


        final Log log = new Log(5);

        TextField textField = new TextField(
                "My value should get to server when tree is clicked");
        addComponent(textField);
        textField.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                log.log("TF value now:" + event.getProperty().getValue());
            }
View Full Code Here

        container = new MockupContainer();
        container.setSize(100000);

        final TextField tf = new TextField("Rows");
        tf.setValue(String.valueOf(100000));
        tf.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                container.setSize(Integer.parseInt(tf.getValue().toString()));
            }
        });
View Full Code Here

    /** Create new TextField with given caption and listener. */
    public TextField textfield(String caption,
            Property.ValueChangeListener changeListener) {
        TextField c = textfield(caption);
        c.addListener(changeListener);
        return c;
    }

    /** Create new FormLayout and add it to current component container. */
    public FormLayout formlayout() {
View Full Code Here

        Label separatorLabel = new Label(" / ", Label.CONTENT_XHTML);
        final Label totalPagesLabel = new Label(
                String.valueOf(getTotalAmountOfPages()), Label.CONTENT_XHTML);
        currentPageTextField.setStyleName(Reindeer.TEXTFIELD_SMALL);
        currentPageTextField.setImmediate(true);
        currentPageTextField.addListener(new ValueChangeListener() {
            private static final long serialVersionUID = -2255853716069800092L;

            public void valueChange(
                    com.vaadin.data.Property.ValueChangeEvent event) {
                if (currentPageTextField.isValid()
View Full Code Here

    }

    private TextField makeTextField(final String colType) {
        TextField t = new TextField(colType);

        t.addListener(new TextChangeListener() {
            SimpleStringFilter filter = null;

            public void textChange(TextChangeEvent event) {
                Filterable f = (Filterable) m_table.getContainerDataSource();
View Full Code Here

  @SuppressWarnings("serial")
  public static Field createCPFField(String prompt, String caption) {
    final TextField listenedField = createTextField(prompt, caption);
    listenedField.setImmediate(true);
    listenedField.addListener(new ValueChangeListener() {

      public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
        if (listenedField.getValue() != null) {
          try {
            listenedField.setValue(TextUtil.format(listenedField.getValue().toString(), "999.999.999-99", true));
View Full Code Here

  }

  public static Field createPhoneField(String prompt, String caption) {
    final TextField listenedField = createTextField(prompt, caption);
    listenedField.setImmediate(true);
    listenedField.addListener(new ValueChangeListener() {

      private static final long serialVersionUID = 1L;

      @Override
      public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
View Full Code Here

  @SuppressWarnings("serial")
  public static Field createFormattedField(String prompt, String caption, final String formato, final boolean direcao) {
    final TextField listenedField = createTextField(prompt, caption);
    listenedField.setImmediate(true);
    listenedField.addListener(new ValueChangeListener() {

      public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
        if (listenedField.getValue() != null) {
          try {
            listenedField.setValue(TextUtil.format(listenedField.getValue().toString(), formato, direcao));
View Full Code Here

      bottomLeftCorner.addComponent(sf);
      sf.setWidth("100%");
      sf.setInputPrompt(pn);
      sf.setImmediate(true);
      bottomLeftCorner.setExpandRatio(sf, 1);
      sf.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = -9134435813501558505L;

        public void valueChange(ValueChangeEvent event) {
          addressBookData.removeContainerFilters(pn);
          if (sf.toString().length() > 0 && !pn.equals(sf.toString())) {
View Full Code Here

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.