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

Exception when (de)selecting checkbox in Dialog

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 5.3.1
    • None

    Description

      In a Dialog I have an OptionGroup with Checkboxes. When the last checked check box is de-selected, the following Exception is Thrown:

      com.vaadin.data.util.converter.Converter$ConversionException: Cannot convert class java.util.LinkedHashSet to class java.util.LinkedList

      After this every checkbox checked/unchecked causes the same Exception.

      Something seems to go wrong in the ListToSetTransformer. When I override the ListToSetTransformer.writeToItem(T newValue) method like this:

      public void writeToItem(T newValue) {
      Property<T> p = getOrCreateProperty(type, true); // !! SET checkTypes TO TRUE !!

      if (p.getValue() instanceof List && newValue instanceof Set) {
      newValue = (T) new LinkedList((Set) newValue);
      if (((List<?>) newValue).isEmpty())

      { newValue = null; }

      }
      p.setValue(newValue);
      }

      the Exception is gone and everything seems to work correctly. Could this be the solution? Or am I missing something?

      Includes are the stacktrace and screenshots of the steps taken.

      Checklists

        Acceptance criteria

        Attachments

          1. stacktrace.txt
            10 kB
          2. step1.png
            step1.png
            386 kB
          3. step2.png
            step2.png
            386 kB
          4. step3.png
            step3.png
            393 kB

          Activity

            People

              Unassigned Unassigned
              ghooning geert hooning
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Bug DoR
                  Task DoD