requestFocus and new record

I have a method attached to the requestFocus event of an element. This method checks if there is a row to provide data to the element and if there is no record to create one:

if (controller.recordIndex == 0)
{
	controller.newRecord();
	
	elements.blabla.requestFocus(false);
}

As you can see I then want to give the focus back to the element immediately without re-performing the method. Unfortunately one has to click a second time in the field to get real focus.

This looks like misbehaviour to me…

OK, I got it. It is the time the controller needs to save the row. When I do this:

if (controller.recordIndex == 0)
{
	controller.newRecord();
	application.sleep(500)
	elements.note.requestFocus(false);
}

It works like expected. Shorter doesn’t (or maybe it will on systems with faster hdu’s). Longer gives a really unwanted delay in showing the cursor in the right position like in fact this already does…