Refeshing User Management component

I have a filterUser() script, set up, but it only works on the initial load of the component. Has anyone been able to refresh the component via scripting?

I cant seem to make system.db.refresh work, likely because its not an SQL binding.

Hello!

Are you talking about the filterUser() extension function on the User Management component?
If so, that function gets called once per each time a user is added to the component. As you’ve pointed out, that happens when the component first loads. You can force the user management component to reload by calling .updateTables() on it, which will re-filter the users.

I tried this out with a Text Field and a User Management component on a test screen.
The text field had the following propertyChange event:

if event.propertyName == 'text':
	um = event.source.parent.getComponent("User Management")
	um.updateTables()

And the filterUser function on the manager was:

	txt = self.parent.getComponent("Text Field").text
	
	if user.get('username') == txt:	
		return True
	else:
		return False

Whenever the text field updates, the users get updated and filtered by the content of the text field.

1 Like

That’s exactly what I was looking for! Thank you so much!