List component select all

I’m populating a List component with a query and I’m trying to use a Check Box to select all of the values in the List. I can use the function addSelectionInterval(start, end) to select the values in the List component, the problem I’m having is determining how many items are in the list for use as the end argument in the function. If I assign an arbitrary large value as the end argument (one larger than the number of values in the List) I will get an ArrayOutOfBounds error when I try to use the function getSelectedValues().

You can use the rowCount property on a dataset.

rowCount = event.source.parent.getComponent(‘List’).data.rowCount

Good luck!


Well you can determine the end by getting the length of the dataset and subtracting one. In scripting something like:ds = event.source.getComponent("List").data end = len(fpmi.db.toPyDataSet(ds))