OMG, like NO WAY. (editable text boxes)!

iOS: Add isEditable property to text boxes (native.newTextBox) to support multiline input text

… I just don’t even believe it !!!

Super excited for this… making the pre-assumption it’s works. :wink: I will try to play tonight.

Thanks! :slight_smile:
~~Kenn [import]uid: 13859 topic_id: 14598 reply_id: 314598[/import]

… Well, very basic test and IT WORKS.

I almost fell out of my chair.

Huge update… I can’t believe how quietly it was added? :wink: [import]uid: 13859 topic_id: 14598 reply_id: 54015[/import]

… might want to document somewhere that native.newTextBox gets a “Fieldhandler” call with this … ie:

textBox = native.newTextBox( 27, 105, 270, 185, fieldHandler )
[import]uid: 13859 topic_id: 14598 reply_id: 54018[/import]

Oops, guess we forgot to tweet, err I mean, that was part of the plan — to have one you guys see the daily build comment and mention it in the forums :slight_smile:

http://developer.anscamobile.com/reference/index/objectiseditable [import]uid: 26 topic_id: 14598 reply_id: 54020[/import]

Awesome. :slight_smile: And here’s a couple notes for the road… these are “minor” in that having any type of editable textbox is just awesome enough. But here’s my update after playing for about 2 hours.
–> Changing the height/width of a text box scales it, it doesn’t actually change the size, that’s inconvenient for doing a full screen textbox that changes size to account for the keyboard when you tap on it. If you leave it full screen, of course you can’t see what you’re typing beneath the keyboard.

–> I tried various ways to rectify this, include instantly removing the textbox and creating a new one of the correct size, with the text. Unfortunately, this type of setup only works with a delay of about 1000 ms between the initial user tap to the time you can show the keyboard for the new textbox. Otherwise, the keyboard seems to get stuck with the original field that’s been removeSelf’d… which is weird.

–> I also tried creating both large and small textboxes, keeping the small one off screen and then, on the “began” phase of the large textboxes, moving large out and the small one into place, and changing the keyboard focus. Unfortunately the “fail” there is that the cursor disappears so you basically have no idea where in the textbox you’re editing unless you’re typing something and new letters magically appear.
**> The end result is that I kept both my large and small textbox. I have the full screen textbox as NON-editable and I added an “edit notes” button, which switches textboxes to the small, editable one and changes itself to a “save notes” button. tapping save notes returns to the full screen view with no keyboard. (I could create them on the fly, but it seems a little quicker on the iphone to keep one offscreen and move them around as needed.)
All in all and in the end, I was able to make a pretty decent looking “notes” field in my latest app with about 2 hours of toying. If I had known what I know now, it would have taken about 10 minutes. :smiley:

Thanks much… I think this is a great thing for Corona and opens the door to a whole lot of “different” apps.

… and be sure to check out all the stuff on Apple Push Notification I sent to Carlos… *evil persistent grin*

[[edit to correct egggzageration of 3 hours – i only toyed for 2 hours. lol]]
Best,
~~Kenn
[import]uid: 13859 topic_id: 14598 reply_id: 54027[/import]

i am also in love with the new iseditable textbox

now i can offer my users create notes etc.

one thing i am looking forward right now to solve.(but that will be something self coded or by community)
to filter special chars like emoji code or arabic letters etc.

right now i push the text my users wrote into an email (simple openurl with mailto:) but
each arabic letter or emoji char does let crash the app… without that letters it works all fine

:slight_smile:

[import]uid: 4795 topic_id: 14598 reply_id: 55085[/import]

@guruk:

Would you being willing to share a sample on how you would implement create notes?

That would be very helpful.

Thanks,

WJ.
[import]uid: 66859 topic_id: 14598 reply_id: 55105[/import]

@MeApps

for sure no prob, also its a very simple example:

local pretext = “hello world”
inputField = native.newTextBox( 50, 150, 680, 500, handlerFunction )
inputField.inputType = “default”
inputField.text = pretext
inputField.isEditable = true
inputField.size = 18
localGroup:insert(inputField)

also this only works on daily build CoronaSDK 2011.609 (iOS) 2011.611 (Android)
as you need the isEditable flag thats till now not in the official corona release

greets
chris

[import]uid: 4795 topic_id: 14598 reply_id: 55163[/import]

Sorry for maybe asking a obvious thing, but how can i fetch the text?

i tried

local fieldHandler = function( event )  
 print( event.phase )  
 if "began" == event.phase then  
  
 if op then  
 op.text = "began"  
 else  
 op = display.newText("began", 5, 5, nil, 14)  
 end  
  
 elseif "ended" == event.phase then  
  
 op.text = "ended"  
 inputText = inputBox.text  
  
 elseif "submitted" == event.phase then  
 -- do something  
 end  
end  
   
local inputBox = native.newTextBox( 10, 40, 300, 100, fieldHandler )  
inputBox.isEditable = true  

but it don’t work. inputText is nil after the listener call.
[import]uid: 53732 topic_id: 14598 reply_id: 57617[/import]

I have found the problem by myself. The “local” declaration of inputBox was the problem. It took me some hours to find this.

But it makes absolutely no sense to me. First of all, should a local textBox work as well. And to make the confusion perfekt - it works if i declare inputBox at the beginning as local.

So the problem is just the word “local” in front of inputBox, and not his real namespace.

I would appreciate if anybody could explain this to me?
Please excuse my english, its not my first language.

Regards,
Mike [import]uid: 53732 topic_id: 14598 reply_id: 57652[/import]