How to make checkbox default to check and execute save with checkbox in 2 columns?

I have a scenarios wherein I want to make the isRequired default to check and only save those changes with check. And also want to save changes when the checkbox is untick. And also how to save if I have 2 checkbox in my table since i have isrequired and iscompleted? And once I will load the page again I want to make the checkboxes check if it is completed only. I need to make the checkboxes check if it is already true in the database since I have isRequired and isCompleted as boolean in my table? Can you show me the processes or provide OML that will help me on this issue. Thank you


Hello Christian,

If you are using a TableRecords to show those lines, and the boolean fields are present in the entity, you just need to bind the checkboxes (associate them with variable) to the attributes using something like this:

CheckBox property Variable = YourTableRecordsName.List.Current.YourEntityName.YourBooleanAttributeName.

When the list is built, if the entity has true for the boolean field, the checkbox associated with it will be checked from start.

After this, in runtime, every change you do to the checkboxes are reflected in the YourTableRecordsName.List.Current.YourEntityName.YourBooleanAttributeName

Cheers.

Eduardo Jauch wrote:

Hello Christian,

If you are using a TableRecords to show those lines, and the boolean fields are present in the entity, you just need to bind the checkboxes (associate them with variable) to the attributes using something like this:

CheckBox property Variable = YourTableRecordsName.List.Current.YourEntityName.YourBooleanAttributeName.

When the list is built, if the entity has true for the boolean field, the checkbox associated with it will be checked from start.

After this, in runtime, every change you do to the checkboxes are reflected in the YourTableRecordsName.List.Current.YourEntityName.YourBooleanAttributeName

Cheers.

How will I be able to do a save in the server action when I have 2 checkboxes to save?  This is my save process on the 2 checkboxes is this correct?




Why are you duplicating the list?

The most common case to duplicate is if you need to delete or add items in the list, what seems not to be the case here...

But I don't understand what do you mean by saving the "checkboxes"...

Is the entity where you want to save the information a different entity from the one you are showing the records on the screen?

Eduardo Jauch wrote:

Why are you duplicating the list?

The most common case to duplicate is if you need to delete or add items in the list, what seems not to be the case here...

But I don't understand what do you mean by saving the "checkboxes"...

I just copied the way how multi select is being done. Is it not right? Saving checkboxes meaning saving the value of checkbox if save. And if I untick it It will delete the record in the table.

Eduardo Jauch wrote:

Is the entity where you want to save the information a different entity from the one you are showing the records on the screen?

The entity on the list is from a different table but it only contains the list. The entity where will I save the record is different from the list.

Hi Christian.

It depends. If you are refreshing the entire TableRecords, I don't think you need, as you are not removing the records from the LIST itself.

Basically, what you want is to iterate the list, check if the value of the attribute boolean is true or false, and execute some logic depending on this value, right?

If you are doing this, yes, that's the way of doing it...

But... If the Boolean attributes are not PRESENT in the entity but are computed columns in the AGGREGATE that is the origin of the table records, you can set the formula to True or False, and the checkboxes will have those values.

In the ForEach, the list will have those attributes and you just check them.

Are you doing like this?

Cheers.

Eduardo Jauch wrote:

Hello Christian,

If you are using a TableRecords to show those lines, and the boolean fields are present in the entity, you just need to bind the checkboxes (associate them with variable) to the attributes using something like this:

CheckBox property Variable = YourTableRecordsName.List.Current.YourEntityName.YourBooleanAttributeName.

When the list is built, if the entity has true for the boolean field, the checkbox associated with it will be checked from start.

After this, in runtime, every change you do to the checkboxes are reflected in the YourTableRecordsName.List.Current.YourEntityName.YourBooleanAttributeName

Cheers.


Hi Eduardo,

I already set the default value of the field in data as true. Then i bind the value of the field in the variable. But it is not working.