cancel
Showing results for 
Search instead for 
Did you mean: 

How to display different form fields based on selection of dropdown ?

kalpesh_c2
Star Collaborator
Star Collaborator

Hi Community Members,

I am developing one Aikau page. I want to display document filtered by two properties in tabular format. For that, I have defined one content type having two properties.

In my scenario, a second dropdown list is to be populated based on selection of first drop-down value. So, if user selects ABC from first dropdown, without page refresh, values of second dropdown will be populated. User selects PQR from second dropdown and clicks on "Search" button. This will trigger repo webscript. Repo webscript will filter data based on two properties. On share side, this data will be displayed in table.

If anybody has any close example/demo/reference/tutorial, it will be great help.

Thanks,

Kalpesh

ContCentric

1 ACCEPTED ANSWER

ddraper
World-Class Innovator
World-Class Innovator

Yes, basically as Angel Borroy‌ is saying you can use the forms configuration to control which fields are displayed based on the changing value of other fields. The form controls page on the Sandpit has some examples of this. The Aikau tutorial also has a chapter that covers this.

All form controls extend BaseFormControl which provides common configuration properties for dynamic visibility, enablement and requirement behaviours. What you're probably looking for is autoSetConfig, or possibly to make use of the form dependant options (using the "ALF_GET_FORM_VALUE_DEPENDENT_OPTIONS" topic).

There's a good example of this in the CloudSyncService (check out the widgetsForSyncDialog configuration) where the site drop-down is updated based on the changing value of the network dialog. If you want to see this in action then you can get the unit test application running and try it out there.

Let me know if you need any assistance getting your form configuration working.

View answer in original post

3 REPLIES 3

angelborroy
Community Manager Community Manager
Community Manager

Are you using Aikau forms? Maybe this sample can help you Aikau Sandpit 

Hyland Developer Evangelist

Hi Angel,

Thanks for sharing this link! Much helpful. Yes, I am going to use Aikau form. I will give this a shot and update you back.

Thanks,

Kalpesh

ContCentric

ddraper
World-Class Innovator
World-Class Innovator

Yes, basically as Angel Borroy‌ is saying you can use the forms configuration to control which fields are displayed based on the changing value of other fields. The form controls page on the Sandpit has some examples of this. The Aikau tutorial also has a chapter that covers this.

All form controls extend BaseFormControl which provides common configuration properties for dynamic visibility, enablement and requirement behaviours. What you're probably looking for is autoSetConfig, or possibly to make use of the form dependant options (using the "ALF_GET_FORM_VALUE_DEPENDENT_OPTIONS" topic).

There's a good example of this in the CloudSyncService (check out the widgetsForSyncDialog configuration) where the site drop-down is updated based on the changing value of the network dialog. If you want to see this in action then you can get the unit test application running and try it out there.

Let me know if you need any assistance getting your form configuration working.