Another input question

basil99

Active Member
Licensed User
Longtime User
Hi!

Played a lot with great InputDialog library, but feel a bit unsatisfied. I have labels/buttons and when user clicks I need to get numerical input. With InputDialog lib i got great popup first, then if i click the input field, i'm redirected to system numerical dialog.

Is it possible to invoke system numerical keyboard in Sub _Click and how to handle events and return value ?

Thank you
 

basil99

Active Member
Licensed User
Longtime User
Is the problem that the keyboard doesn't appear automatically? If I remember correctly there was no way to automatically show the keyboard in the case of modal dialogs.

No, all well with InputDialog lib, my question: is it possible to code like that:

B4X:
Sub Button_Click

Dim code as int

code = CallSystemNumericalInput( text )

if code = Ok

     newtext = CallSystemNumericalInput.text

end if

End sub
 
Upvote 0

basil99

Active Member
Licensed User
Longtime User
B4X:
Dim d As InputDialog
d.InputType = d.INPUT_TYPE_NUMBERS
d.Show("aaa", "Ddd", "yes", "", "", Null)

Well, Erel, I know how to use InputDialog lib ) I mean SYSTEM dialog with numeric keyboard setted
 
Upvote 0

basil99

Active Member
Licensed User
Longtime User
What is system dialog?

May be I name it wrong. I mean a standart Android dialog with input field, keyboard etc. You got it when you click InputDialog input area.

Another example - if you declare EditText view, clicking on it, invokes input dialog
 
Last edited:
Upvote 0

basil99

Active Member
Licensed User
Longtime User
I see. You are referring to the soft keyboard, right?
B4X:
EditText1.InputType = EditText1.INPUT_TYPE_NUMBERS

Correct. Can I do the same with other views like labels and buttons ? Like that

B4X:
SomeView.Text = SomeView.INPUT_TYPE_NUMBERS
 
Upvote 0

basil99

Active Member
Licensed User
Longtime User
I think you need to rephrase the question as it is not very meaningful at the moment. the INPUT_TYPE constants are for deciding what type of user input is accepted and Buttons and Labels don't accept input.

Okay, lets try again. How to invoke software numerical input of Label_Click or Button_Click ?
 
Upvote 0

basil99

Active Member
Licensed User
Longtime User
Sorry, but I still don't understand. Buttons and Labels don't accept input - unless I'm missing something obvious!

Well, let me try to explain it another way
Assume, i'm a user. I click button or label and get the software keyboard dialog. So, my question - is this possible to code ? If yes, how ?
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Well, let me try to explain it another way
Assume, i'm a user. I click button or label and get the software keyboard dialog. So, my question - is this possible to code ? If yes, how ?
If you click on a button, you will not get a software keyboard! :eek:
If your button opens an InputDialog, then the keyboard will open.
A keyboard only opens in an EditText that is enabled.
 
Upvote 0

basil99

Active Member
Licensed User
Longtime User
If you click on a button, you will not get a software keyboard! :eek:
If your button opens an InputDialog, then the keyboard will open.
A keyboard only opens in an EditText that is enabled.

Okay, seems i got it. If you want to assign any input to label/button click event, you need to have some edittest as "middleman"
 
Upvote 0
Top