Accessing Fields in a Table View Form

I have a form which appears in a tabpanel. I use a table view in this form to display all the rows of the associated table and a checkbox at the left of each row to enable the user to choose 1 or more of the rows. However, I am uncertain how to check the value of the checkboxes (and other fields) once the user has indicated that they are finished selecting. When I use elements.btnCheckbox, I get the value of just the last selected row. And the system does not accept elements.btnCheckbox[1].

I know this must be a trivial thing, but how do I access each element of each display row?

Thanks, Steve

You always have to attach a dataprovider to the elements that take user input. Like a field.

In case of a checkbox you attach a dataprovider of type integer and this will work.

In a table view you can’t use a global for that so you have to create a column in your database. Afterwards you could clear it using a foundset updater.

IT2Be:
You always have to attach a dataprovider to the elements that take user input. Like a field.

In case of a checkbox you attach a dataprovider of type integer and this will work.

In a table view you can’t use a global for that so you have to create a column in your database. Afterwards you could clear it using a foundset updater.

Yes, I have the checkbox attached to an unstored calculation. So, when that row is selected, I can access the value of the checkbox. What I want to do is to be able to access the values of ALL of the checkboxes and the other fields, too.

Steve

In that case you will have to loop through the records

IT2Be:
In that case you will have to loop through the records

So, the way I came up to do that is to get the size of the foundset and then loop through each of them by using setSelectedIndex(x). Is that the best way, the only way or is there another or better way?

Thanks for the confirmation.

Steve

Yes there is a better way.

When you do setSelectedIndex you do loop over the foundset but update the ui as well. Potentially slow.

The best you can do is retrieve the record and find the column value.