Karthi Ponnusamy
Karthi Ponnusamy

Reputation: 2031

Titanium Textfield on TableView not getting focused

I am having few text fields inside the table view, while clicking on the text fields it is not getting focused(in Android platform). I have seen some questions regarding the same issue, but those suggestions not worked for me. I am using Titanium 1.7.5, Android 2.2

Upvotes: 0

Views: 3458

Answers (3)

Balwinder Pal
Balwinder Pal

Reputation: 97

I resolved this problem in Android to set the Edit Text Property:

android:imeOptions="actionSearch"

If it is not working on Mobile Device, I have another solution for it:

android:imeOptions="actionNext" android:selectAllOnFocus="true"

Upvotes: 2

mkind
mkind

Reputation: 2043

textfields did not act identically on every device while gaining the focus. you should have a look at the softKeyboardOnFocus-property. it can have the following value:

Titanium.UI.Android.SOFT_KEYBOARD_DEFAULT_ON_FOCUS
Titanium.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS
Titanium.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS

maybe it helps to set the property to SOFT_KEYBOARD_SHOW_ON_FOCUS. this requests to show soft keyboard on focus. keep in mind that android can override this.

Upvotes: 0

Rene Pot
Rene Pot

Reputation: 24815

I had the same issue, and some steps you should keep in mind:

  • Don't add a focus event to the field, this will overwrite the build-in one
  • Add the event singletap and fire the focus event on that field

mytextfield.addEventListener('singletap',function(){ mytextfield.focus(); });

This should do the trick, at least, it did for me.

Upvotes: 1

Related Questions