Itvisors / mendix-AutocompleteMultiselect

Auto complete widget where multiple options can be selected.
Other
2 stars 2 forks source link

Refresh/ Reload of the Data for the Widget #4

Closed RachanaBP closed 2 years ago

RachanaBP commented 2 years ago

Hi Johan, I am facing an issue with Refreshing the Data Source of the widget. If i could Reload the Data source based on an attribute/boolean it would be helpful. To explain further.. I am using the widget for filter options I have 3 filters , Once Filter 1 is selected Filter 2 and Filter 3 should be dependent on Filter 1 option selected. When i refresh the context object after selection of Filter 1, DS of Filter2 , Filter 3 gets called.. however, DS of Filter 1 also gets refreshed and the selected value vanishes... to Resolve this is tried to set Default Selected String Field with the Json but it doesn't work.. So instead of Refreshing the context object i would like to reload the data for Filter 2 and Filter 3 using a Boolean. Let me know incase u need any more clarifications. otherwise Widget Works great. Thanks for it :)

jeuhen commented 2 years ago

Hi Rachana,

The trigger of the datasource is handled by mendix. However, I don't understand why the value of filter 1 disappears when you only refresh the context object, or do you also set the refresh boolean of the widget to true? Another option can be that you have a non-persistent helper per widget, e.g. filterHelper with the response, etc. Then you can only refresh the filterhelpers of filter 2 and 3. However the values shouldnt be cleared if you only do a refresh of the context object, I also just tried it but was not able to break it. If above is not helping, is it possible for you to share a small demo project, such that I can have a look?