158
Views
5
Comments
Solved
Select checkboxes in order (enable only one at a time)
Application Type
Reactive
Service Studio Version
11.54.1 (Build 62118)

Hello everyone!

I'm new to Outystems and I am working on a site for my Company. 

I was asked to make a table with monthly payments and my idea is for the user only to select the payments in order. For example, at the start, the first payment will be the only enabled, and once I select it, the next one is enabled, and so on.  We don't want the user to select payments that are not recent.

The data comes from a REST API so I'm working with a list (structures)

I can't provide an oml since it has private information, but here's a couple of screenshots:

Only the first enabled

Enable only the next

And so on...

I would really appreciate your help!

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

You need to do some workaround on list and create logic in a way that it will work, So I have created some If conditions with respect to the selection, and based upon that I am changing the enabled property of a checkbox.

So I made it in a way if you uncheck any of the check box based upon that all the checkbox that are below that row number will be unchecked, So I tried to cover most stuff there using Rownumber 

I am attaching a Oml Sample for you hope that will help you with that, You can check the logic and try to do the same or modify it based upon your requirements.

Sample - https://personal-ejuytnht.outsystemscloud.com/SampleForumPOCS/CheckBOx

I hope this will help you 

Thanks
Tousif Khan

SampleForumPOCS_Selected Checkbox.oml
2023-03-30 15-07-51
MaríaPaz Jélvez

Thank you, Tousif! It worked perfectly!!! Thank you so much!!!!!

2023-10-21 19-42-11
Tousif Khan
Champion

You are welcome. 
I am glad that I was able to help you with this :)

Best Regards
Tousif Khan

2025-01-31 20-15-29
Hamza Gulzar
Champion

In the aggregate you can add a new variable and use it for enabling and disabling checkboxes.

Everytime on selecting checkbox, you can use Onclick event and set -next row variable to true (list[currentrownumber]+1.variable) 



2023-03-30 15-07-51
MaríaPaz Jélvez

Thank you for your answer! How can I implement that with a structure? (I'm not working with aggregates) I have already added the new attribute "isEnabled" to it,  I try to select the next row but it doesn't work.

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

You need to do some workaround on list and create logic in a way that it will work, So I have created some If conditions with respect to the selection, and based upon that I am changing the enabled property of a checkbox.

So I made it in a way if you uncheck any of the check box based upon that all the checkbox that are below that row number will be unchecked, So I tried to cover most stuff there using Rownumber 

I am attaching a Oml Sample for you hope that will help you with that, You can check the logic and try to do the same or modify it based upon your requirements.

Sample - https://personal-ejuytnht.outsystemscloud.com/SampleForumPOCS/CheckBOx

I hope this will help you 

Thanks
Tousif Khan

SampleForumPOCS_Selected Checkbox.oml
2023-03-30 15-07-51
MaríaPaz Jélvez

Thank you, Tousif! It worked perfectly!!! Thank you so much!!!!!

2023-10-21 19-42-11
Tousif Khan
Champion

You are welcome. 
I am glad that I was able to help you with this :)

Best Regards
Tousif Khan

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