Deleting records from dataset locking up page

I have two tables on a page and based off the selection of table ‘A’ I retrieve some data and then I need to filter the data for table ‘B’. I am doing so with the following code on ‘PropertyChange’ but after a selection or two on table ‘A’ the page becomes useless and freezes for a very long time. With the code removed the page works fine. Any suggestions?

I do not have access to modify the stored procedure that calls for the data of table ‘B’ that is why i am trying to filter on my side.

table = event.source.parent.getComponent('B')
data = table.data
unwanted = []

if data.rowCount > 0:
	for row in range(data.rowCount):
		if data.getValueAt(row, "ItemType")=="02":
			unwanted.append(row)

	newData = system.dataset.deleteRows(data, unwanted)
	table.data = newData

First, I don’t see an ‘if’ block in your procedure checking the whether the event is for the ‘data’ property. Look at the example in the manual for the propertyChange event. That’s vital to prevent lock-ups. For similar reasons, you must never write back to the same property in a propertyChange event. That makes an infinite loop of events on that property. You need to bind your stored procedure to a custom property of type ‘Dataset’, monitor for its changes, and write to the Table ‘B’ .data property with the filtered content.

Thank you, thank you! been fighting this for two days. Totally makes since to me now and is working great!