[DOCU-1965] Documentation on creating a custom 'select' field with dynamic options list. Created: 08/Oct/19  Updated: 28/Oct/19  Resolved: 25/Oct/19

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Development Support Request Priority: Neutral
Reporter: Travis Munroe Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot at 2019-10-17 16-03-27.png     PNG File image-2019-10-17-16-10-32-502.png    
Template:
Date of First Response:

 Description   

I'm looking for documentation on how I might be able to create a 'select' field where the options list comes from an external source (e.g. REST service, database query, etc.).  Ideally, I'd want this for a 'twinColSelect', but I imagine the process is the same or similar.  Does such documentation (or sample code) exist?



 Comments   
Comment by Simon Lutz [ 24/Oct/19 ]

Hi tmunroe,

which version of Magnolia are you using? We are currently working on our REST client functionality and will ship light development capabilities with Magnolia 6.2 As a part of that, we are also improving the documentation and code samples. We do have some samples ready, but they are built using light development, so will only be applicable as of 6.2.

Best regards,
Simon

Comment by Travis Munroe [ 24/Oct/19 ]

Hi Simon,

We are currently on 5.7.3 but plan to migrate to 6.2 when it's available.  I was able to get something working by extending info.magnolia.ui.form.field.factory.SelectFieldFactory and overriding the getOptions() method.  Will this still work on 6.2 or does this all change with the move to Vaadin 8?

Thanks,

Travis

Comment by Simon Lutz [ 25/Oct/19 ]

Hi Travis,

that depends a bit on your context. Magnolia 6.2 will have a compatibility layer to take care of custom implementations. If you are using this implementation in your own app, then you should have no issue. If you are using a Magnolia app that we will port to the new UI framework with 6.2 (e.g. Pages), then you will have to use the legacy app most likely until you have ported your custom implementation.

The good news are that it will be much easier to implement such things as of 6.2; you will be able to define a datasource and bind your select to it - with the declarative REST functionality, you won't even need coding efforts.

I hope that helps you. I will close this ticket. If you need anything else, please create a ticket in the SUPPORT-project.

Cheers,
Simon

Generated at Mon Feb 12 01:22:52 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.