how to clear PRIM_MD.Dropdown in a VL web dialog
Posted: Fri May 05, 2023 5:56 am
I have a VL web dialog with two md dropdown components from lists.
The second dropdown list is dynamically built depending on the value in the first dropdown.
I have both dd lists initially built in the .Prepare event.
First execution of the dialog works fine, with the second dropdown populated with the expected values.
But, if I change the value in the first dropdown, how can I clear the previous values in the second dropdown, so it can then be repopulated from the new list values?
Currently:
dropdown #1 values are #source1 and #source2.
When dropdown #1 initially has the value of as #Source1, then
dropdown #2 is populated from a list that has values: #listItem1 and #listItem2.
If I change dropdwon#1 so that it's value is now #source2, this then builds a new list (with only a value of #listItem3) to use in dropdown #2, but instead of resulting in a fresh dropdown listing of only #listItem3, I end up with a dropdown#2 have the previous values, plus the new value - #listItem1, #listItem2, and #listItem3.
The working lists that are used to build the dropdowns are being cleared (clr_list) and a log output shows that the list only has the correct new value, it is just the MD Dropdown that I am not seeing how to clear it out before it is being rebuilt / repopulated?
The second dropdown list is dynamically built depending on the value in the first dropdown.
I have both dd lists initially built in the .Prepare event.
First execution of the dialog works fine, with the second dropdown populated with the expected values.
But, if I change the value in the first dropdown, how can I clear the previous values in the second dropdown, so it can then be repopulated from the new list values?
Currently:
dropdown #1 values are #source1 and #source2.
When dropdown #1 initially has the value of as #Source1, then
dropdown #2 is populated from a list that has values: #listItem1 and #listItem2.
If I change dropdwon#1 so that it's value is now #source2, this then builds a new list (with only a value of #listItem3) to use in dropdown #2, but instead of resulting in a fresh dropdown listing of only #listItem3, I end up with a dropdown#2 have the previous values, plus the new value - #listItem1, #listItem2, and #listItem3.
The working lists that are used to build the dropdowns are being cleared (clr_list) and a log output shows that the list only has the correct new value, it is just the MD Dropdown that I am not seeing how to clear it out before it is being rebuilt / repopulated?