Is it possible to have multiple buttons linked to one checkbox from a tablerecord?

Is it possible to have multiple buttons linked to one checkbox from a tablerecord?

  

Dear community,

Me and my classmates are working on a project where we need to make a backoffice for a company. We have made a tablerecord with checkboxes on the side of the records. Our idea is to check the boxes and press 'Accepted' or 'Declined' which of course activates a different action listener. 

Our issue is that the checkbox can only link to one value(button). Is it possible to link the checkbox to more then one value? We can only link the checkboxes to the 'Accepted' boolean. Making two different checkboxes next to each other could be a fix, but that's not really user-friendly.

Thanks in regards!

Bunyamin Ozcan

Hello Bunyamin

The buttons or links you are using for 'Accepted' and 'Declined' have an 'enabled' property. You can create a local variable named IsEnabled (boolean) and bind it to that property. Next, the OnChange of the Checkbox should be an action that only changes  the IsEnabled local variable to true and refreshed the table. This way, clicking on a Checkbox will automatically activate both links

Hope this helped

Regards,

Ângelo 

Ângelo Sousa wrote:

Hello Bunyamin

The buttons or links you are using for 'Accepted' and 'Declined' have an 'enabled' property. You can create a local variable named IsEnabled (boolean) and bind it to that property. Next, the OnChange of the Checkbox should be an action that only changes  the IsEnabled local variable to true and refreshed the table. This way, clicking on a Checkbox will automatically activate both links

Hope this helped

Regards,

Ângelo 

Dear Angelo,

Thank you for the reply, but that was not our issue. Our problem is that the checkbox is bounded to only one of the buttons which is 'Accepted' at the moment. I can click 'Declined' but the boolean is not linked to that button, so the action of 'Declined' will not be performed. We have two entity attributes, which are both booleans called 'Accepted' and 'Rejected'. We can only link the checkbox to one attribute and not two.

We want to link both of the entity's to this one checkbox. In the screenshot you can see on that the variable is only linked to 'Accepted' attribute. We want to link the checkbox to two of them.

I hope this makes our problem a bit more clear.

Thanks!

Bunyamin


Hey Bunyamin,

I was wondering why you are using 2 booleans? If your accepted is false doesn't this mean he is rejected? Just link your buttons to an action where you assign the value of the boolean -> if you click on reject you put your boolean on false else on true.


Regards,


Nick

Hello Bunyamin

Not quite sure I understand the issue here. Let me explain what I understood, and you tell me if I'm correct
1) You have a record list
2) You want to select N items on that list using a checkbox in each row
3) After selecting the records, you want the Accepted and Rejected links to be enabled
4) You want to click one of the links to perform a desired action (either Accept or Reject the record)

Am I right?
If this is the case,  you should be using a boolean attibute on your query (e.g. IsSelected) and bind the checkbox to that attribute (no need to create this attribute on the database, just add it to the aggregate). After this, you can develop the logic for both actions and enable the link as I  told you previously


Regards,

Ângelo

Ângelo Sousa wrote:

Hello Bunyamin

Not quite sure I understand the issue here. Let me explain what I understood, and you tell me if I'm correct
1) You have a record list
2) You want to select N items on that list using a checkbox in each row
3) After selecting the records, you want the Accepted and Rejected links to be enabled
4) You want to click one of the links to perform a desired action (either Accept or Reject the record)

Am I right?
If this is the case,  you should be using a boolean attibute on your query (e.g. IsSelected) and bind the checkbox to that attribute (no need to create this attribute on the database, just add it to the aggregate). After this, you can develop the logic for both actions and enable the link as I  told you previously


Regards,

Ângelo

Yess, this is the concept on what we are working on right now. We are a bit stuck in step 4 because the checkbox is bound to one data attribute. Are you suggesting that the boolean attribute needs to be a local variable? We are already trying to work this out with what Nick is saying. Running it on one boolean instead of two different booleans, but it is still not working properly at the moment.

Thanks in regards,


Bunyamin


Is the source of the TableRecords an aggregate? If so, you can add a o boolean attribute to it on the Sources tab and name it IsSelected (for example). You then bind the checkbox to this attribute. 

After that, you'll need to develop the logic for each button (Decline and Accept) for each record the user selected

Hello Bunyamin,

Our issue is that the checkbox can only link to one value(button). Is it possible to link the checkbox to more than one value? 

If that means you want get all selected checkbox, you can use the ListFilter with table record list.

Regards,

Adel

Bunyamin, can I offer a small idea?

You have a list with check boxes. If you press "accept", you want to update the record so that it reflects this new state (accepted), otherwise, if you press "reject", you want to update the record so that it reflects this new state (rejected).

First thing. How do you know that a record was already accepted or rejected? The only way is to have a "third" state: pending. If you have 3 states, you know which records are accepted, rejected, and which ones you didn't processed yet. There are other ways of doing this, of course. For example, you can have a date field that is NullDate while a decision was not made, and have a date when a decision was made.

In the first case, you need something like a static with 3 records (pending, accepted, rejected), and a FK to this static in your entity. In the second case, you need a date field (to store the date when a decision is made), and a nother field to know if it is accepted or rejected (that can be a boolean, like IsAccepted).

I prefer the first, for conceptual reasons, so my example will use the first.

What you need to do is to create a SINGLE Screen Action, with an InputParameter, boolean, named like IsAccepted.

Now, in this screen action, you do a ForEach in the TableRecords list (the list of the table in the screen), and for every record (current) whose the boolean field (bound to the check box) is true, you check the input parameter. If the input is also true, update the record with the id of "accepted" (from the static entity), otherwise, update with "rejected".

And that's it. :)

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Bunyamin, can I offer a small idea?

You have a list with check boxes. If you press "accept", you want to update the record so that it reflects this new state (accepted), otherwise, if you press "reject", you want to update the record so that it reflects this new state (rejected).

First thing. How do you know that a record was already accepted or rejected? The only way is to have a "third" state: pending. If you have 3 states, you know which records are accepted, rejected, and which ones you didn't processed yet. There are other ways of doing this, of course. For example, you can have a date field that is NullDate while a decision was not made, and have a date when a decision was made.

In the first case, you need something like a static with 3 records (pending, accepted, rejected), and a FK to this static in your entity. In the second case, you need a date field (to store the date when a decision is made), and a nother field to know if it is accepted or rejected (that can be a boolean, like IsAccepted).

I prefer the first, for conceptual reasons, so my example will use the first.

What you need to do is to create a SINGLE Screen Action, with an InputParameter, boolean, named like IsAccepted.

Now, in this screen action, you do a ForEach in the TableRecords list (the list of the table in the screen), and for every record (current) whose the boolean field (bound to the check box) is true, you check the input parameter. If the input is also true, update the record with the id of "accepted" (from the static entity), otherwise, update with "rejected".

And that's it. :)

Cheers,
Eduardo Jauch

Dear Eduardo,

Your idea is very interesting and we already tried to implement this in our application. We made a small progress by making a static entity with the records "pending" "accepted" and "rejected". In our main entity we made a FK called "StatusId" and have set it's identifier to "Status identifier".

After that we made a input parameter called IsAccepted with the data type boolean in the screen where the table record is. The checkbox has now the IsAccepted input parameter as its variable. It displays in yellow a warning mentioning "The variable of the Check box inside the ArtikelenTable Table Records is not bound to the widget's List variable" . I'm not sure if i'm already sidetracking here. Is this ok?

We tried to make the Screen Action like you said but we seem to do it wrong. I am including the image of our flow with this post. Our flow is probably wrong too. Can you give feedback in what we need to adjust?

Thanks in regards,

Bunyamin


Solution

Hi Bunyamin,

the checkbox should be bound to an attribute in the list, not to the input. 

if your list comes from an aggregate, add a calculated field with value false, and bound your check box to this attribute in the list in screen.

The action input is used by the buttons to say if is to accept or reject.

In the action, you foreach the screen list and check if the calculated column is true or not. Use this info to set the state.

Cheers,

Eduardo Jauch

Solution

Bunyamin Ozcan wrote:

Dear community,

Me and my classmates are working on a project where we need to make a backoffice for a company. We have made a tablerecord with checkboxes on the side of the records. Our idea is to check the boxes and press 'Accepted' or 'Declined' which of course activates a different action listener. 

Our issue is that the checkbox can only link to one value(button). Is it possible to link the checkbox to more then one value? We can only link the checkboxes to the 'Accepted' boolean. Making two different checkboxes next to each other could be a fix, but that's not really user-friendly.

Thanks in regards!

Bunyamin Ozcan


Hi, is this what are you looking for?


Attached the simple OML to achieve this.


Things you may need to put more attention:

1. Do not forget to give the name for every link or button that is going to be linked with the checkbox.


2. All button/link id that is going to be linked with the checkbox should be separated by coma.


3. Add Boolean structure on the preparation. The boolean value will be the variable of each row of the table.


It is finally fixed! Thanks for all support!

Hi Bunyamin,

It's nice to hear.
Please, if one of the answers is the correct one, mark it as solution.
If, not, tell us what you did and than mark your own answer as the correct :)

Cheers,
Eduardo Jauch