The example that is provided in the above link uses a AEM Form with no template (neither XDP nor XSD).
I tried creating a AEM form based on a XDP, The ajax call to populate the state drop down does not work when there is a bind reference to the state field. Also in my XDP i earlier defined the country dropdown in the Livecycle Designer in the List Items in the Fields Tab, and used the field in my AEM form, but in Authoring mode if I tried to change the country list, the country dropdown does not render the new values. Is there an inherent issue with AEM Forms based on XDP to create conflict.
Please help me find a solution to the above problem or let me know if authoring of values and dynamic pre population of AEM Forms drop down is a no possible use case.
As a workaround, you can have two drop downs dropdown1, dropdown2. dropdown2 is non-binded field and you can populate it dynamically as mentioned in article. dropdown1 would be binded with xfa dropdown with two additional expression: visibility expression set to false. calc expression set to dropdown2.value