[MGNLUI-6755] defaultValue in TextField with type Long doesn't work Created: 17/Jun/21  Updated: 18/Jun/21  Resolved: 18/Jun/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.8
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 0.1d
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Relates
supersession
is superseded by MGNLUI-6375 Remove generic type of default value ... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 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



 Comments   
Comment by Mercedes Iruela [ 17/Jun/21 ]

MGNLUI-6386's tip is not making any difference.

Comment by Roman Kovařík [ 18/Jun/21 ]

I can reproduce on 6.2.8 but not on 6.2.9 (http://demo.magnolia-cms.com/) or latest (http://nightly.magnolia-cms.com/) This was likely fixed by MGNLUI-6375.

Comment by Carlos Cantalapiedra [ 18/Jun/21 ]

Fixed in version 6.2.9

Generated at Mon Feb 12 09:39:41 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.