Hi Team,
We want to create a dilog field where we can load drop-down option of api response when dilog is opened can we try this from datasourse or data source call backend each time when opened?
Solved! Go to Solution.
You can create a clientlib with some custom js like this:
(function (document, $) {
"use strict";
$(document).on("foundation-contentloaded", function (e) {
// do your custom code here
});
})(document, Granite.$);
Then call the clientlib in the component dialog xml using "extraClientlibs" property. This JS will called when you open the dialog.
NB. There are some other event available also like you want to do some thing on submit of a dialog.
Thanks.
@ashishm85330433 DataSource is the best suggested approach to load dropdown options as we can make secure API call to third party system. Its easy to maintain the tokens and other API configuration in backend approach.
We can go ahead with @AsifChowdhury approach, if the 3rd party is public and doesn't require any token to access the same. In this we may not require whitelisting to access API.
Thanks @Imran__Khan but how datasourse will call servlet.
Follow below for the same
http://www.sgaemsolutions.com/2019/01/dynamically-populate-drop-down-values.html
Please check https://aemlab.blogspot.com/2022/01/aemaacs-touch-ui-dialog-dynamic-dropdown.html
@ashishm85330433 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies