[OutSystems Data Grid] NewValue and OldValue return different things in OnChange action for dropdowns
data-grid-reactive
Reactive icon
Forge component by Platform Maintenance
Application Type
Reactive

Hello,

When you create an OnChange action for a dropdown column, the Old Value returns the dropdown text while New Value returns the dropdown value. We're using the default parameters as is.

I don't think there are any details to share, I don't think anything we did could cause this, so I'm pretty sure it's a bug. If it's not please let me know.

Thanks

Hello @Daniele Betti ,

After reviewing these use cases we confirmed you are correct. We've noticed that this is quite a strange behavior and we'll be fixing our DataGrid component to return the value instead of the text. This will cause a breaking change, but we believe that is a necessary change in order to make things right. Also, we tried to return both values but on some scenarios like undo/redo Wijmo APIs only return the value which in real case scenarios is really the most common one

Hi Taha,

It would be good, if you share sample OML.

Please check that you are passing the Name or ID in old value.

If its name, try changing it to ID and check.


Regards,

Wasim Khan S

Hello Wasim,

Like I said, I'm using the default parameters as is. 

These parameters appear automatically when you create an OnCellValueChange action, you can try it yourself if you like.

Any news on this old topic? I have the same issue.

Hi Daniele,


Can you let us know which DataGrid version you are using? I didn't manage to reproduce this issue. 

Right! It was on old version... but anyway I updated to the 2.7.0 and now the issue is different: NewValue and OldValue contain the Text attribute and not the Value attribute of the dropdown option.

Is that wanted?

There is a way to pass the Value attribute (with the id of the static entity in my case)?

We weren't able to solve this, so I'd like to know how it's working in the newest version (which we're not on).

Hi @Mehmet Taha Aydin with the latest version NewValue and OldValue contain both the Label attribute of the DropddownOption.

The strange thing is that when you retrieve the changed line (on save) I get the Value attribute inside the Label attribute of the target object


Hello @Daniele Betti ,

After reviewing these use cases we confirmed you are correct. We've noticed that this is quite a strange behavior and we'll be fixing our DataGrid component to return the value instead of the text. This will cause a breaking change, but we believe that is a necessary change in order to make things right. Also, we tried to return both values but on some scenarios like undo/redo Wijmo APIs only return the value which in real case scenarios is really the most common one

Hi @Gabriel Lundgren ,

thank you!

Please note also that there is another strange behaviour related to the same: sometimes when I get the changed lines as the user wants to save, the "Label" attribute of the object binded to the dropdown column contains the id (and the id is set to 0), sometimes contains correctly the text value of the label (and the id contains the correct id).

I currently solved this with a workaround: if the Label is number then I get this, otherwise the id attribute. 

Hey, can you send a sample so we can reproduce this?

Ok, I'll try to create an oml. Stay tuned ;-)

I create and oml and... I dnd't figured out how to replicate my behaviour (sometime Label with text and sometimes with Id), but I have in anycase a strange behaviour: Label contains always a numeric value, but sometimes is the same as the Id attribute, often is different... and it seems the the correct new Id is always contained in the Label attribute.

Label and Id are attribute of Area static entity.

TestLabelValue.oml

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.