[MGNLUI-6936] Unable to convert String to Long in select fields Created: 03/Nov/21 Updated: 09/Nov/21 Resolved: 09/Nov/21 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | dialogs |
| Affects Version/s: | 6.2.12 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Chris Jennings | Assignee: | Unassigned |
| Resolution: | Not an issue | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| 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 |
| Comments |
| Comment by Roman Kovařík [ 03/Nov/21 ] |
|
Any reason to define the values as Integers and then using String -> Double conversion instead of: comboSelect: $type: comboBoxField type: java.lang.Double datasource: $type: optionListDatasource options: - name: one value: 1.0 - name: two value: 2.0 ? |
| Comment by Luke Trueman [ 03/Nov/21 ] |
|
Hi rkovarik - I just tried that and it worked. It states in the documentation that you need the converter class though: https://docs.magnolia-cms.com/product-docs/6.2/Templating/Dialog-definition/Field-definition/List-of-fields/Combobox-field.html#_common_simple_field_properties Should this be updated or have I misunderstood?
|
| Comment by Roman Kovařík [ 04/Nov/21 ] |
|
Good point, the common properties docu is inherited into all field types but I think this applies only to different text fields. cc akhamis E.g. in this example: The optionListDatasource uses OptionLinkConverter by default so we can't use a StringToNumberConverter as there is no String but an Option. |
| Comment by Roman Kovařík [ 09/Nov/21 ] |
MGNLUI-6937 |