Popup with numeric entry wont focus with a value

I've made a popup in perspective. In the popup i'm presenting a value and want to change the value using my keyboard without first selecting the numeric entry field. So the numeric entry needs to have the focus so i can change the value.

On the numeric entry field im running a script in the System Events :onStartup

def runAction(self):
waarde = system.tag.read(self.view.params.Tagpath).value
self.props.value = waarde
self.focus()

This results in a numeric entry field with the focus and i can change the value without selecting the numeric entry field, but without the initial value

def runAction(self):
waarde = system.tag.read(self.view.params.Tagpath).value
self.props.value = waarde

This results in a numeric entry field with the initial value but without the focus

How can i combine these two ?

Tip: Please see Wiki - how to post code on this forum.

Instead of injecting the tag values from a script you might want to use a property or tag binding.

hi, thank you for your input.
I've tried that without positive result.