[MGNLUI-3772] Support BeanItems with enum members Created: 15/Feb/16 Updated: 09/Feb/17 Resolved: 12/Aug/16 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | forms |
| Affects Version/s: | None |
| Fix Version/s: | 5.4.9, 5.5 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Mikaël Geljić | Assignee: | Mikaël Geljić |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | BeanItem, smallapp, vaadin | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 3.5h | ||
| Original Estimate: | 3.5h | ||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Patch included: |
Yes
|
||||||||||||||||
| 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)
|
||||||||||||||||
| Release notes required: |
Yes
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Epic Link: | Phase out Admin-interface Legacy | ||||||||||||||||
| Sprint: | Saigon 56 | ||||||||||||||||
| Story Points: | 8 | ||||||||||||||||
| Description |
|
Many small apps use our form framework (vs. plain Vaadin forms) to build forms from configuration, and benefit from validation styles. It is then possible to use the form framework with Vaadin BeanItems, for example. However, it is not possible to "bind" an OptionGroup field to an enum member of a BeanItem. Several reasons for that:
If for some reason we don't want to do any of the above, one has to resort in using booleans or Strings in BeanItems, which is simply less elegant. Finally, if our form-framework were more elegant (e.g. wrapping plain Vaadin forms, or not self-imposing itself just for the sake of validation bubbles), this would surely be a lot more trivial: such binding takes less than 5 minutes to do with plain Vaadin. |
| Comments |
| Comment by Mikaël Geljić [ 15/Aug/16 ] |
|
For release notes:
|
| Comment by Evzen Fochr [ 15/Nov/16 ] |
|
What i rly hate is this part Enhancements for Field Factories: because of it, product detail subapp in commercetools is broken. It used tranformers to pick correct text from LocalizedString class served by CommercetoolsProductItem (which is BeanItem child) |
| Comment by Mikaël Geljić [ 15/Nov/16 ] |
|
Transformers are a JCR-specific facility for mapping node-structures to field implementations. |
| Comment by Evzen Fochr [ 15/Nov/16 ] |
|
Subclassing BeanItems should help in my case, but I dont know how would i solve displaying f.e. MonetaryAmount in 2 different ways in same form (once currency first and on other place currency last). |
| Comment by Mikaël Geljić [ 15/Nov/16 ] |
|
Converters are most likely the answer to that one; as far as I see, it's also independent from those localized-strings. Let's arrange a session/call, comments on a closed ticket are a bit limited |