List box refresh problem

List box refresh problem

  

I use 3 list boxes: A, B and C to perform a drill down:

Select an item inbox A will refresh items in box B, but select an item in box B does not refresh box C. Under debugger, in the box B action, the select ID of A is reset but I cannot see how. Am I doing it wrong?

What is the solution? OML attached.

Thanks,

Stanley

Forgot to mention v10.0611.0

Hello Stanley,

A couple things.

1. You shouldn't refresh the Container where it is the List that triggered the OnChanges, because this will also refresh the list and you will loose the selected values.

2. When in debug, only variables that are being used will have its values shown. This means that when you enter the OnBChange, as you are not using A there, it will not show its value, but if you put a feedback message to show it, it will show and you will be able to see its value in the Debuger.

According to THIS post, the List widget doesn't work properly with aggregates. The solution found there was to COPY each element to a local list. This will require extra logic as you will have to clear and copy from a local aggregate (in the OnChanges) to the local list every time.

It seems that this problem still persists.

Would you consider using ComboBox instead? As you are not "multi-selecting", its an option (a good one), and will also allows you to use, for example, the Select2 widget, that will give "autocomplete" abilities to your combo boxes.

Cheers,
Eduardo Jauch

Hi Eduardo,

There are only a few items in the second and third list boxes, the user can see all of them and select right away, so no need for the heavy duty ComboBox or Select2.

I updated the refreshed widgets to the list boxes and use local list variables, now the problem is the select variable is not set in the local list.

Please see the attached file.

Thanks,

Stanley

Solution

Hello Stanley,

It is because in the BChange you are iterating over the LOCAL list to find the selected, but the local list is used only as source to the ldB.list, so, it is in the last one that the Select is being defined. Changing this it will work :)

https://eduardojauch.outsystemscloud.com/CascadeLists2/Home.aspx?_ts=636425760924004358

Cheers,
Eduardo Jauch

Solution

Of course! What was I thinking?

Thanks Eduardo!