Why is the widget not passing the Status?

The things works when switching a recognition from active to inactive. But when trying to do the reverse, my IsSelected Boolean shows up true within the widget but within the variable it's assigned to it shows false. Why is that?

This is the widget within the debugger

Solution

Hi Jaret,


This is a common misconception with many developers who are recent starters on OutSystems.

Firstly, the local variable list and ListWidget list do not share the same memory location for the data. That is they are entirely different list internally. A copy of List data is created when widget is bound to local List variable. Similarly List.Current is also a copy of the List item at the index of currentrownumber of the list.


Therefore when you are updating the data of a list either at local variable level and re-bind it to the widget

OR

Use widget.CurrentRowNumber to get the index and use the index to update the data in the local variable list.


Hope this help you understand how OutSystems handle local variables and widgets.


Regards,

Saugat

Solution

Saugat Biswas wrote:

Hi Jaret,


This is a common misconception with many developers who are recent starters on OutSystems.

Firstly, the local variable list and ListWidget list do not share the same memory location for the data. That is they are entirely different list internally. A copy of List data is created when widget is bound to local List variable. Similarly List.Current is also a copy of the List item at the index of currentrownumber of the list.


Therefore when you are updating the data of a list either at local variable level and re-bind it to the widget

OR

Use widget.CurrentRowNumber to get the index and use the index to update the data in the local variable list.


Hope this help you understand how OutSystems handle local variables and widgets.


Regards,

Saugat

Thank you sir!