text not entering fields
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Re: text not entering fields
Their workaround doesn't work - so I've put in another request for help. Any script that I put in the input field doesn't register on mouseup (on the Android device) - even if I put answer "hi"
on mouseUp
put "input" into tControlType
mobileControlCreate tControlType, "myFirstInputField"
mobileControlSet "myFirstInputField", "visible", true mobileControlSet "myFirstInputField", "rect", "50,50,500,500"
end mouseUp
Inputting text still works fine on my computer... but the answer "hi" doesn't fire on my computer either.
on mouseUp
put "input" into tControlType
mobileControlCreate tControlType, "myFirstInputField"
mobileControlSet "myFirstInputField", "visible", true mobileControlSet "myFirstInputField", "rect", "50,50,500,500"
end mouseUp
Inputting text still works fine on my computer... but the answer "hi" doesn't fire on my computer either.
Re: text not entering fields
Not sure about all the other stuff going on, but a mouseup script in a livcode field that is unlock never fires. If the field is locked then it does. Clicks on an unlocked field (or touches) focus the field and set the insertion point.
cusingerBUSCw5N wrote:Their workaround doesn't work - so I've put in another request for help. Any script that I put in the input field doesn't register on mouseup (on the Android device) - even if I put answer "hi"
-
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Re: text not entering fields
Thanks...I locked the field and yes, it does work now - in a weird way. It creates new field and text is put in there - but you have to tap my field first, then tap the new field and type... Also, you have to set a specific rect, which may vary based on the device size.
Can't it just type in the field I created? (I already created myFirstInputField.... - it created a second one)
Here's the code
I want this bug to go away...
Can't it just type in the field I created? (I already created myFirstInputField.... - it created a second one)
Here's the code
Code: Select all
on MouseUp
put "input" into tControlType
mobileControlCreate tControlType, "myFirstInputField"
mobileControlSet "myFirstInputField", "visible", true
mobileControlSet "myFirstInputField", "rect", "50,50,100,100"
end mouseUP
Re: text not entering fields
I think there is some confusion going on here.
First, I don't know why the LC field isn't letting you type into it, I've had no problems with that.
Second, the native field. It has nothing to do with the field you placed on the screen in the ide. (if I understand correctly)
To do what I think you want to do, put your script into preopencard. The card opens, the field is there ready to use. You don't want to be creating a new one every time you click the field.
Then destroy it in closecard.
I haven't actually messed with the native fields, so there is a chance i'm completely and totally wrong, so do some experimentation and make sure i'm not off base.
I guess you could do it a different way. Create your layout in the ide, then when you click it, create a native field that overlays the locked field you just clicked. When done editing in the native field, put its contents in your locked field and destroy the native. No clue what the best method would be, I've had good luck with the non-native fields (I do very uncomplicated stuff so far) and the lc fields have been serving me well.
First, I don't know why the LC field isn't letting you type into it, I've had no problems with that.
Second, the native field. It has nothing to do with the field you placed on the screen in the ide. (if I understand correctly)
To do what I think you want to do, put your script into preopencard. The card opens, the field is there ready to use. You don't want to be creating a new one every time you click the field.
Then destroy it in closecard.
I haven't actually messed with the native fields, so there is a chance i'm completely and totally wrong, so do some experimentation and make sure i'm not off base.
I guess you could do it a different way. Create your layout in the ide, then when you click it, create a native field that overlays the locked field you just clicked. When done editing in the native field, put its contents in your locked field and destroy the native. No clue what the best method would be, I've had good luck with the non-native fields (I do very uncomplicated stuff so far) and the lc fields have been serving me well.
-
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Re: text not entering fields
My stupidity. Yes, I put it in preopencard and it works just fine.
I would love to know that this work on an android with auto-suggestion keyboards - I've tested it on a couple with just one field, and it won't type. Tech support has said that it's a bug, it's not me.....
anyway, there is hope because there is a workaround. Now I have to do script so it if is mobile, it does my workaround...if it isn't, it just has fields...
I would love to know that this work on an android with auto-suggestion keyboards - I've tested it on a couple with just one field, and it won't type. Tech support has said that it's a bug, it's not me.....
anyway, there is hope because there is a workaround. Now I have to do script so it if is mobile, it does my workaround...if it isn't, it just has fields...
Re: text not entering fields
That should be easy enough to do. You can use "the environement" and a few other things to determine where you are running.
if the environment is "mobile" then
do mobile stuff
else
#do non-mobile stuff
end if
Or a switch statement
switch the environment
case "mobile"
#do mobile stuff
break
case "development"
#only do this stuff while in the ide
break
end switch
if the environment is "mobile" then
do mobile stuff
else
#do non-mobile stuff
end if
Or a switch statement
switch the environment
case "mobile"
#do mobile stuff
break
case "development"
#only do this stuff while in the ide
break
end switch
-
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Re: text not entering fields
One step forward, 3/4 steps back....
Here is the workaround code that sets up a field that can be typed in:
Before I had this problem, my field's location was set in layout using this code:
set the top of field "password" of me to the bottom of field "label_getdocs" + tverticalspace
but the new workaround uses a rect...and so when I tried:
set the top of field "myFirstInputField" of me to the bottom of field "label_getdocs" + tverticalspace
it failed.
set the rect of field "myFirstInputField" of me to the rect of field "password"
also failed
Because the device size will vary, setting a specific rect, like "50,50,150,150" won't work.
So...how do I set it up so it resizes and repositions itself with the other items in the stack?
Also, I need a way that Livecode recognizes that this is a field - so I can call its contents. I'm not sure it understands field "myFirstInputField"
Thanks...
Here is the workaround code that sets up a field that can be typed in:
Code: Select all
if the environment is "mobile" then
put "input" into tControlType
mobileControlCreate tControlType, "myFirstInputField"
mobileControlSet "myFirstInputField", "visible", true
mobileControlSet "myFirstInputField", "rect", "50,50,100,100"
mobileControlCreate tControlType, "mysecondInputField"
mobileControlSet "mysecondInputField", "visible", true
mobileControlSet "mysecondInputField", "rect", "150,150,400,400"
set the vis of field "password" of this card to false
end if
set the top of field "password" of me to the bottom of field "label_getdocs" + tverticalspace
but the new workaround uses a rect...and so when I tried:
set the top of field "myFirstInputField" of me to the bottom of field "label_getdocs" + tverticalspace
it failed.
set the rect of field "myFirstInputField" of me to the rect of field "password"
also failed
Because the device size will vary, setting a specific rect, like "50,50,150,150" won't work.
So...how do I set it up so it resizes and repositions itself with the other items in the stack?
Also, I need a way that Livecode recognizes that this is a field - so I can call its contents. I'm not sure it understands field "myFirstInputField"
Thanks...
Re: text not entering fields
Hi,
1. it is really about time that you look up some basic mobile features in the "Release Notes"!
2. "myFirstInputField" if of course no Livecode object that you can control with the regular Liveocde syntax
3. "myFirstInputField" is a native ANDROID control that has been created on the fly with YOUR script above
4. you can only use the syntax supplied by Livecode to control these native objects, so if you can only set its RECT
then you need to compute that rect somehow, which should be a snap, since you know your layout, don't you?!
5.
...
put mobilecontrolGet("myFirstInputField","text") into tUserEnteredText
## do something with tUserEnteredText
...
Best
Klaus
1. it is really about time that you look up some basic mobile features in the "Release Notes"!
2. "myFirstInputField" if of course no Livecode object that you can control with the regular Liveocde syntax
3. "myFirstInputField" is a native ANDROID control that has been created on the fly with YOUR script above
4. you can only use the syntax supplied by Livecode to control these native objects, so if you can only set its RECT
then you need to compute that rect somehow, which should be a snap, since you know your layout, don't you?!
5.
You can GET almost everything that you can SET, see 1.:Also, I need a way that Livecode recognizes that this is a field - so I can call its contents.
...
put mobilecontrolGet("myFirstInputField","text") into tUserEnteredText
## do something with tUserEnteredText
...
Best
Klaus
-
- Posts: 339
- Joined: Wed Jul 11, 2012 9:24 pm
Re: text not entering fields
Thanks. I have been using the Android Developer notes...Unfortunately, there are two paragraphs and no examples. Anyway, I have solved the placement of the new fields, because after I set the original fields and make them visible=false for mobile environment, then I set the rect of my new field to match the original ones. Here is the code I use:
I have solved the getting data out of the new fields with this code:
I have also killed the mobilecontrols on card close:
I have a couple of issues connected with multiline mobilecontrols, but I am going to put them in a separate question so that people can find them.
Code: Select all
set the top of field "title" of me to the bottom of image "top_background7.png" of me + tVerticalSpace*2
set the width of field "title" of me to (tStackWidth * 0.70)
set the left of field "title" of me to tStackWidth*0.15
if the environment is "mobile" then
mobileControlSet "myseventhInputField", "rect", the rect of fld "title"
end if
Code: Select all
if the environment is "mobile" then
put mobileControlGet(myfirstinputfield, text) into temail
else
put field "email_address" of this card into temail
end if
I have also killed the mobilecontrols on card close:
Code: Select all
if the environment is "mobile" then
mobileControlDelete myseventhInputField
mobileControlDelete myeighthInputField
end if
Re: text not entering fields
Please do ALWAYS use quotes here:
...
put mobileControlGet("myfirstinputfield", "text") into temail
...
mobileControlDelete "myseventhInputField"
mobileControlDelete "myeighthInputField"
...
...
put mobileControlGet("myfirstinputfield", "text") into temail
...
mobileControlDelete "myseventhInputField"
mobileControlDelete "myeighthInputField"
...