Issue with on focus

Good afternoon,

I am trying to input data in a textfield. At startup I want it to be active, cursor flashing in it. I have tried to do the following:

On the component itself, config event, onstartup, script self.focus()
and I have tried on the perspective view, config event, onstartup, script self.getChild("root").getChild("TextField_0").focus()

niether of which are sucessful. What am I doing wrong?

Then after I input that data I want it clear out and refocus on itself, I have this:

	Time = system.date.now()
	test_obj = self.session.custom.test_obj
	Name = self.session.custom.testName
	databaseConnection = "IgnitionHud"
	Badge_Num = self.props.text[1:11]
	for M in test_obj:
		pydict = M['value']
		if pydict['ShawEmployeeID'] == Badge_Num:
			isAccountedFor = pydict['isAccountedFor']
			Name = pydict['EmployeeFullName']
			if not isAccountedFor:
				system.db.runPrepUpdate("INSERT INTO SM_CheckIn (Time, Name, Badge_Num) VALUES (?,?,?)", [Time, Name, Badge_Num])
				self.props.text = ''
				self.focus()

As a change script on the text field.

This is being used on a tablet.

UPDATE:

Not sure why this would matter but it does.

When opening the perspective project up via the app it doesnt focus on the textfield, but when opening via a web browser it does focus.

Any Ideas?