B4J Question Editable ComboBox TextChanged

BPak

Active Member
Licensed User
Longtime User
I have Two Editable ComboBox on a Form and need to get the Text from the Combos.

If an item is selected then it works fine but if a different entry is made I need to use it also.

Tried us ing code found on forum but it gives an error.

Thanks for any help.
 

Attachments

  • CTC.zip
    4.3 KB · Views: 274

BPak

Active Member
Licensed User
Longtime User
You can handle the ValueChanged event. It combo box.raised when the user presses enter or when the field loses focus:
B4X:
Sub ComboBox1_ValueChanged (Value As Object)
   Log(Value)
End Sub
Enter key does - yes.
Change focus to another control does not get value. ?
From combobox
 
Upvote 0

BPak

Active Member
Licensed User
Longtime User
I've tested with two ComboBox and it did raise this event.
I do not see any lose focus event for combobox.
I type a word into a combo box edit and then click on another control.
No event from combo box is activated.
Must be a problem with my computer or setup of b4j .
Value changed only activates if I click enter after typing into combo box edit.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Unfortunately, there is not an event like "LostFocus"; this is one of the first things I missed (B4A).



Edit: there is a similar event (FocusChanged with HasFocus = False) but it does not fire always
 
Last edited:
Upvote 0

BPak

Active Member
Licensed User
Longtime User
Unfortunately, there is not an event like "LostFocus"; this is one of the first things I missed (B4A).



Edit: there is a similar event (FocusChanged with HasFocus = False) but it does not fire always

I deleted combos and used text field with table view. It is only an in house program I am making.
 
Upvote 0
Top