I need the table to select row 0 after a data change

I have a table that stores recipes. When someone selects a recipe if this is a new recipe it will prompt the user to transfer this to the recipe table. The problem I am having is that if they have selected a recipe with 5 rows and they have the 5th row selected and thay try to go to one with less rows it will prompt them to transfer the recipe even though it may be already in the table. I need the table to select row 0 after a data change.

You can do this with a propertyChange script on the table component, like this:

if event.propertyName == 'data' and event.source.selectedRow == -1: event.source.selectedRow = 0

Hope this helps,