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

defaultValue in TextField with type Long doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • None
    • 6.2.8
    • None
    • None

    Description

      Steps to reproduce

      1.  Create a new component like this
        label: Test
        
        form:
          properties:
            limit:
              $type: textField
              label: My Label
              i18n: true
              type: java.lang.Long
              converterClass: com.vaadin.data.converter.StringToLongConverter
              defaultValue: 8
                    
        footerLayout:
          $type: defaultEditorActionLayout
          primaryActions:
            commit: commit
      2.  Try to create it and check an error is thrown (java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap')

      Expected results

      The dialog opens with the default Value loaded on the textField

      Actual results

      The dialog doesn't open because an error is thrown

      Workaround

      N/A

      Development notes

      If removed the defaultValue property, it works as expected and the transformerClass transforms the field from String to Long

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                ccantalapiedra Carlos Cantalapiedra
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - Not Specified
                      Not Specified
                      Logged:
                      Time Spent - 0.1d
                      0.1d