For Each - Table Records

For Each - Table Records

  
I have a table records with a list navigation bar and for each page I only show 20 records of the table records. I want to have a foreach that goes to all of the records of the table records, and not just the ones that are in the current page of the table records.

For example, if the table records has, in total, 60 records, I will have 3 pages of 20 records. If I am in page 2 and I run the for each, it will only run the records in that page (records 21-40), but I want the foreach to go to every row (60).

Thanks for your help
So this appears to be a solution looking for a problem.  What exactly are you trying to accomplish with the 'For Each'?  If it's some sort of totaling there are much better ways of doing it.  Let us know what the goal is and I know someone can provide a good solution.

Curt
Basically I have one column with a check box that contains an attribute called "value", from a structure called "Boolean". The idea is to select multiple rows of the table records (in diferent pages or on the same page) and then click in one button that will run an action only in the rows where the check box is true. 

That's why I need the for each, so that I go to all the records of the table records, and not just the ones in the current page.

Thanks
Here's what I would do.

1) Add the boolean to the entity with all the rest of the data, if it's not there already.
2) Use an Editable table widget instead of the Table record widget, allowing the user to update the boolean values for each record on the page
3) When the user is done and clicks the special button, use an aggregate that looks for all the records where the boolean is true and perform the appropriate action.  The For Each on the aggregate will work no matter how many records or pages there are.
4) Optionally, set the boolean values back to false if needed

Hope that helps,
Curt
But isn't there a simple way to make the foreach go to all the records? That's the only thing I need.

Thanks
Sure, just create a second aggregate and do the For Each on that.  Though if you have a large number of records your performance may suffer.

Curt
The problem is because the boolean value is not saved in the database (it's always false), even if I create antoher aggregate it's true that the foreach will go to each record of that aggregate but because they all have the boolean value = false it will not run the action for any record

Thanks
Which is why I suggested in my first approach that the boolean has to be part of the record, so it is saved.  If that solution doesn't work I wouldn't know what else to try without knowing a lot more about your application.  Sorry I couldn't help more.

Curt