Locking an ios text input with mobilecontrolset

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
peramangk
Posts: 22
Joined: Wed Jul 04, 2007 11:45 am

Locking an ios text input with mobilecontrolset

Post by peramangk »

I've tried locking both an input and a multiline with -
mobileControlSet scrollidStudents, "enabled", false
mobileControlSet scrollidStudents, "editable", false
but they are still editable.
They need to be locked most of the time to avoid accidental changes, but still need to be viewable.
Apart from this, they are behaving as expected.

What am I missing?
Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Locking an ios text input with mobilecontrolset

Post by Jellicle »

I use this in a current project:

Code: Select all

 mobileControlSet hMultilineControlD, "editable", "false"
Works fine.

Are you sure that the script your example code is from has access to the scrollidStudents variable?

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
peramangk
Posts: 22
Joined: Wed Jul 04, 2007 11:45 am

Re: Locking an ios text input with mobilecontrolset

Post by peramangk »

I have a button on the same card as the mobile control.
It acts as a toggle for lock/unlock, containing a script to make the scroller editable/not editable (and a few other things).
I would have thought that the button has access to the properties of the scroller.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Locking an ios text input with mobilecontrolset

Post by Klaus »

Hi permangk,

how and wehre did you define the ID of the new native control "hMultilineControlD"?
All scripts that will modify that native control need to have access to that variable "hMultilineControlD".

I guess that you create the scroll on "preopencard", so the handler of your button does probably not have access to that variable!


Best

Klaus
peramangk
Posts: 22
Joined: Wed Jul 04, 2007 11:45 am

Re: Locking an ios text input with mobilecontrolset

Post by peramangk »

The id is declared as a global on the card script and the button script.
The scroller is created on openCard.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Locking an ios text input with mobilecontrolset

Post by Klaus »

Aha, well, then it SHOULD work 8)

Maybe you can post your button script?
peramangk
Posts: 22
Joined: Wed Jul 04, 2007 11:45 am

Re: Locking an ios text input with mobilecontrolset

Post by peramangk »

You are perfectly right Klaus - it should work and now it does work.
There was a fault in the line preceding the mobilecontrolset, so the mobilecontrolset was never called.
My apologies and thank you very much for your help.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Locking an ios text input with mobilecontrolset

Post by Klaus »

Okie Dokie :D
Post Reply