We've a requirement where we need to develop cookies component and list of options should be provided and one of the options should be selected by default. We are planning to design component as below. So please advise if this is possible in Touch UI or not or another other better solution for this.
1. Create a multifield ( with Title & Description) and dropdown to with dynamically data(Title of each item added in multifield to be populated in dropdown).
But to populate the dorpdown data dynamically, the data should be stored somewhere. So is there a way we can write listener in touch UI dialog and gets the dropdown data populated automatically every time author changes/add multifiled values?
Thanks Scott and Ratna Kumar for your prompt response.
I've understood the part of populating data dynamically using datasource and able to do it.
But the problem is multifiled data will be stored in repository only we submit the dialog.
Below is the sample dialog which I'm trying. Whenever author add/delete/update fields in the multifiled, the same should be updated in below dropdown field and populated. Example, Option1, Option2 are added in the multifiled and same should be populated in the dropdown. So I'm trying to figureout if there is a way to write events/listeners whenever multifiled is update and populate the same in dropdown, but couldn't find.
Please let me know if it works or if you have any other better options.
You can populate a granite/ui/components/coral/foundation/form/select field with a DataSouce object. To make it dynamic - you can bind it to a WCMUsePojo class that can read the JCR where the data is stored and populate the DataSouce used to populate the select field. This is the best way to dynamically populate a select field.