mobileControlCreate issue...

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

mobileControlCreate issue...

Post by sms5138 » Fri Oct 09, 2015 12:11 am

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: mobileControlCreate issue...

Post by Simon » Fri Oct 09, 2015 8:32 am

Hi Shawn,
Shouldn't sinputId be userName or password?
Or
theEmail and thePassword?

sinputId contains nothing :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: mobileControlCreate issue...

Post by bn » Fri Oct 09, 2015 8:43 am

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

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: mobileControlCreate issue...

Post by sms5138 » Fri Oct 09, 2015 4:14 pm

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

Post Reply