Expand my Community achievements bar.

Without Ajax call fetch component property in authordialog javascript file.

Avatar

Level 2

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

feedbackb.PNG

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

                localhost:4502/content/pagename/jcr:content/abccomponent.json

        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

Avatar

Community Advisor

@dhanubrp,

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.