Page 1 of 1

mobileControlCreate issue...

Posted: Fri Oct 09, 2015 12:11 am
by sms5138
Hi everyone,

I'm trying to create mobile fields (which i've done in previous applications) but they do not seem to create when i launch the application in the iPhone simulator....

here's what i've got... Maybe you guys can see if i'm missing something here...

Code: Select all

on preOpenCard
if the environment is "mobile" then
      mobileSetAllowedOrientations "landscape left,landscape right"
      hide field "email"
      hide field "password"
      mobileControlCreate "input", "userName"
      put the result into theEmail
      mobileControlSet sinputId, "rect", "256,140,760,182"
      mobileControlSet sinputId, "visible", "true"
      mobileControlSet sinputId, "opaque", "true"
      
      mobileControlCreate "input", "password"
      put the result into thePassword
      mobileControlSet sinputId, "rect", "256,264,760,306"
      mobileControlSet sinputId, "visible", "true"
      mobileControlSet sinputId, "opaque", "true"
   end if
end preOpenCard
i'm kind of at a loss on this one... any insight is greatly appreciated.

-Sean

Re: mobileControlCreate issue...

Posted: Fri Oct 09, 2015 8:32 am
by Simon
Hi Shawn,
Shouldn't sinputId be userName or password?
Or
theEmail and thePassword?

sinputId contains nothing :)

Simon

Re: mobileControlCreate issue...

Posted: Fri Oct 09, 2015 8:43 am
by bn
Hi Sean,

isn't this the same problem you solved in

http://forums.livecode.com/viewtopic.ph ... 0&p=129015

You don't store the id or name of the control, which would be usually a script local variable at the top of the script outside of all handlers. Then you know which control you can address to retrieve and store data from that control.
And if you don't have the name or id of the control there is no easy way to delete it.

Kind regards

Bernd

Re: mobileControlCreate issue...

Posted: Fri Oct 09, 2015 4:14 pm
by sms5138
Hey Simon Thanks!

good call. I'm sure that's what it is, and now i feel totally silly haha.

I'll have to try it out when i get home, and report back!

Thanks Bernd for the call back! I'm thinking this was slightly different mainly due to what simon pointed out... silly me... :oops: goes to show you shouldn't work when your tired...

I appreciate all the help!

-Sean