iOS Question How can I create an input form to receive a user value?

davepamn

Active Member
Licensed User
Longtime User
I need an action sheet to receive an input typed in from the User.
 

davepamn

Active Member
Licensed User
Longtime User
Can you provide a code sample?

I was thinking about creating a regular page with a text box on it. I would take up the whole screen. I want am input dialogue instead.
 
Upvote 0

Brian Robinson

Active Member
Licensed User
Longtime User
Hi davepamn.

I modified fillipo's excellent custom dialog class to suit my own purposes for this found here https://www.b4x.com/android/forum/threads/class-customdialog.47778/#content

I have added an example with the class and how to use it.

I can explain anything that you need to know, but basically I add a panel to the dialog and add the controls to that panel. Any controls that you want to get the return value for, then add a tag to it. The button_click of the dialog returns all the values in a map with the tags so that you can iterate over them to get the results. There are definitely much better ways to achieve this, but I decided on quick and dirty for now.

Cheers
Brian
 

Attachments

  • DialogExample.zip
    4.9 KB · Views: 213
Upvote 0

davepamn

Active Member
Licensed User
Longtime User
I ran the sample

A dialog panel appears with a label and textbox for inputting a value.

When i press the Ok or Cancel button, nothing happens. The dialog does not go away.
 
Upvote 0

Brian Robinson

Active Member
Licensed User
Longtime User
Ok... It is supposed to close the dialog, and then shows a message box with the values returned from the dialog.

Did you just run the example exactly as it was, or did you add fields to match how you want it?

Cheers
Brian
 
Upvote 0

Brian Robinson

Active Member
Licensed User
Longtime User
Hi davepamn,

I just downloaded what I uploaded to make sure I didn't miss anything when I uploaded the zip file and ran it on an iPhone and iPad mini. It worked fine on both of those. If anyone else is reading this thread, can you give it a try and see if it works for you?

Cheers
Brian
 
Upvote 0

davepamn

Active Member
Licensed User
Longtime User
I don't know why it doesn't work

My iSideMenu is not working, either.
 
Last edited:
Upvote 0
Top