Commiting in Standard

Hey, i am having trouble trying to use a button that i created to activate and deactivate a boolean.
I was following a tutorial and they used commit, but i can’t find a way to commit in the StandardLookup.
This is the code i tried using.

image

So when i click the button i want it to turn this (Ativa) attribute to false/true, but all it does is change the check in the checkbox but it’s not changed when i go to the editor

image

image

As you can see in this prints i have clicked the deactivate button in the browser and it unchecked the (Ativa) attribute but in the editor it keeps it checked instead of uncheck it.

CubaStudio, by default, generates a StandardLookup screen in read-only mode. Check your attribute <data readOnly="true">.
But for such a scenario, it is better to use the “master-detail screen” template instead of a simple StandardLookup.

Hi,
You are not saving changes in the code snippet you’ve posted.

First, you need to remove readOnly="true" from the screen descriptor, like Andrey pointed out.

Then, you should inject DataContext object to the screen controller.

And finally, after you make changes to any entity which is contained in the data context (any item from the data container is located there) - you can call dataContext.commit() to save performed changes.