Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

TextField onFocus Event

This has been mentioned a few times, but the only fixes I have seen deal with firing a focus event on a textField directly after a window is opened. I am trying to fire a focus() event (iPhone) after a table row is tapped. Here is my code.

Any suggestions?

— asked November 5th 2010 by Jacob Williams
  • focus
  • iphone
  • textfield
0 Comments

1 Answer

  • Simple… the focus() function was called when the field was constructed.
    Insert a DELAY…

    setTimeout(function() {
        tf1.focus();
    },500);
    

    This will resolve your problem.

    — answered November 5th 2010 by Adriano Paladini
    permalink
    1 Comment
    • Thanks for the suggestion, but the event still isn't firing. I even tried to set the delay longer.

      — commented November 5th 2010 by Jacob Williams
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.