I will need help... It's possible to get some extra events for ABMinput component? I will need two option:
1. To raise event, when user press a special key (like F3 or Ctrl + "some key") and/or
2. when is user input ended (f.e. When input field lost focus AND input text is changed)...
How to capture this two events? I cannot find any solution...
You can set this with these two properties. However, be aware that you will get al lot of traffic to your server, especially the Changed event. Use it carefully:
You can set this with these two properties. However, be aware that you will get al lot of traffic to your server, especially the Changed event. Use it carefully:
Yes, I know, that this two events exists... But - maybe - can you suggest me, which event should I use, to make control over input? Just to explain - user should input ID of material, I will check this ID and show the description of material (if material exists in DB)... It's will be useful when I will get event ONLY, when input is done to end...
Or - maybe should I build Button for each input to check input data? No, please, don’t suggest this...
You got Lostfocus, TabPressed and EnterPressed events. they are raised when someone leaves the input, pressed tab (to leave) or Enter.
And then you have the Changed event, which will be raised with every keystroke (not advised).
I mostly use the EnterPressed event (e.g. we have a Search input which when the user presses Enter, I run a query in the database and present only the ones that contain this text in a listbox).
You got Lostfocus, TabPressed and EnterPressed events. they are raised when someone leaves the input, pressed tab (to leave) or Enter.
And then you have the Changed event, which will be raised with every keystroke (not advised).
I mostly use the EnterPressed event (e.g. we have a Search input which when the user presses Enter, I run a query in the database and present only the ones that contain this text in a listbox).
You can cover all three in one if you want, but our users have no problem with only EnterPressed:
B4X:
Dim oldValue as String
Sub input_LostFocus()
Dim input as ABMInput = page.Component("input")
input_EnterPressed(input.Text)
End Sub
Sub input_TabPressed(target As String, value As String)
input_EnterPressed(value)
End Sub
Sub input_EnterPressed(value As String)
if Value <> oldValue then
' do your thing
...
end if
oldValue = Value
End Sub
You can cover all three in one if you want, but our users have no problem with only EnterPressed:
B4X:
Dim oldValue as String
Sub input_LostFocus()
Dim input as ABMInput = page.Component("input")
input_EnterPressed(input.Text)
End Sub
Sub input_TabPressed(target As String, value As String)
input_EnterPressed(value)
End Sub
Sub input_EnterPressed(value As String)
if Value <> oldValue then
' do your thing
...
end if
oldValue = Value
End Sub