I realize this is a total hack, but we weren’t able to find out a different way to set this. If anyone has a better way, I would love to change the way we’re doing this. But it is possible to set focus to a particular field in kinetic.
In our case, we were doing this in pack out entry. When we pack and unpack, we want the focus to return to the part number field after they enter the quantity. To do this, we created an event that triggers after ColumnChanged_Quantity. In the event we added a condition object, and then added an event complete.
For the condition expression we had the system evaluate a setTimeout method after a half a second (500 milliseconds). The function executed gets the reference to particular control (txtPartNum2 in our case), and then gets the reference to the input element and sets the focus to the input element. Here is our condition expression:
Curious… did you use the “on success” type connector like in the above image? Just wondering if that may have been why there were timing issues, it wasn’t waiting for the previous event to be “successful” before changing focus.
When we were trying this without a condition, the control focus set was the only object in the event besides the trigger. The event trigger was after the last event in the chain. There wasn’t an option to mark the connector as “on success” when it was coming from the trigger. The condition is only in there because it allows me to perform javascript which allows me to perform the delay.
What if you set this up as an onblur event of the Qty field? So, when focus leaves the Qty field, the event would fire and set focus to the partnum field.
What you have works, obviously… I’m not trying to be argumentative or anything. Hope I’m not coming off that way. Just spit balling ideas.
No worries. We tried onblur and had the same issue. Because the built in process updates when the quantity field changes, it seems that all these events fire while everything is disabled. Thus the delay. The delay fixed everything. Maybe it would help to have a delay object in the event toolbox?