Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-4546

ConfiguredBinder assumes the null representation of text fields is always a string

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Neutral
    • 6.0
    • None
    • None
    • None

    Description

      Easily reproducible with MGNLUI-4538. The progress columns fails to be edited if the property doesn't exists beforehand, falling back to null representation:

      Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
      	at com.vaadin.data.converter.AbstractStringToNumberConverter.convertToPresentation(AbstractStringToNumberConverter.java:40) ~[vaadin-server-8.4.2.jar:8.4.2]
      	at com.vaadin.data.Converter$2.convertToPresentation(Converter.java:173) ~[vaadin-server-8.4.2.jar:8.4.2]
      

      This is caused be the fact that the null representation is always an empty string:

      //see https://github.com/vaadin/framework/issues/9619
                  if (TextFieldDefinition.class.isAssignableFrom(definition.getClass())) {
                      bindingBuilder = (BindingBuilder<T, PT>) ((BindingBuilder<T, String>) bindingBuilder).withNullRepresentation("");
                  }
      

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              rkovarik Roman Kovařík
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD