DropdownSearch onSelect causing undefined loop in the process

Hi Team.

I am using a DropdownSeach widget from OutsystemsUI in Reactive web. In the OnSelect Event, whenever I call a service action the process will direct back to the start node causing an undefined loop.

I tried using a Dropdown widget and the OnChange event run as expected.

Is there a way to fix it on DropdownSearch?

Thanks in advance

Regards,

Nhorwin

Hi Nhorwin,

Could you please share oml

Solution

Hi Nhorwin,

You may face this issue if you are refreshing the source item list of yor dropdown search widget. 

To avoide this situation you can add one boolean local variable called refreshdata which will work as flag for your case. Keep its default value to true.

In onselect action of your dropdownsearch check if refreshdata = true then refresh your list data (by calling service action in your case but I would suggest you to use fetch data from action instead of calling service action directly in client action) and set refreshdata to false.

If refreshdata = false then just set it to true without refreshing yor dat or calling the service action.

You have to do this because when you refresh the source list this onselect is called again to set you previously selected value so you just have to avoice calling service action again in this specific case.

Solution

Nikhil Gaur wrote:

Hi Nhorwin,

You may face this issue if you are refreshing the source item list of yor dropdown search widget. 

To avoide this situation you can add one boolean local variable called refreshdata which will work as flag for your case. Keep its default value to true.

In onselect action of your dropdownsearch check if refreshdata = true then refresh your list data (by calling service action in your case but I would suggest you to use fetch data from action instead of calling service action directly in client action) and set refreshdata to false.

If refreshdata = false then just set it to true without refreshing yor dat or calling the service action.

You have to do this because when you refresh the source list this onselect is called again to set you previously selected value so you just have to avoice calling service action again in this specific case.

Hi Nikhil,

Thanks for your idea on how to avoid refreshing the source multiple times. It really helps. I still hope this issue should be fix without doing this remedy. Again Thank you.

Regards, 

Nhorwin


Glad that I could help.

Yes, I think this should be resolved in the component and it should work like dropdown but I think this issue is because of different implementation of selection in both the components.

I will report it and I hope they will be able to resolve this in future builds.