Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Without Ajax call fetch component property in authordialog javascript file.


Level 2

We have a component its having 2 fields  , both the fields of type dropdown .


field1 value is hardcoded in component class.


field2 value should load based on field1 value selection.(field2 value will loaded after selecting field1 value)


We have already implemented this.


Now we  need to achieve

Example Scenario:


Step1: We opened component and selected field1 value.

Step2: Then selected field2 value.

Step3: Submitted the component dialog.

 Again when we open the component dialog to make field2 value selected, we need the value stored previously in CRX.


We achieved this by using Ajax call


Example: By calling specific component path


        Then we retrieved  specific component property and made field2  selected.


We need to fetch the previously selected value of field2 without calling Ajax. Is there any way we can achieve this? 


2 Replies


Community Advisor


Based on your scenario, you will need to make an Ajax call regardless. Because field2 uses business logic to populate dropdown options based on the dependency of field1. You will need to add in additional render logic in field2 where if the property already exists, to display that value as a selected drop-down option. With your custom Touch UI dialogue solution, I don't think you can get away without an ajax call.