I haven't been able to change input fields during the openCard handler. Is there some secret command or function that I am missing ? Attached is a sample stack that has an input field and two buttons. The input field has default text of "Default Text", but I am trying to change it on the openCard. One button then displays the value in the input field and another button sets the text.
Currently, when I run this in the iOS simulator, the input field shows "Default Text" instead of the text that is it should display - "Changed on openCard".
Can anyone provide any guidance ?
LC / Mobgui & Changing Input text fields on openCard
Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21
-
- VIP Livecode Opensource Backer
- Posts: 48
- Joined: Sat May 24, 2008 2:27 pm
- Location: Indiana, USA
LC / Mobgui & Changing Input text fields on openCard
- Attachments
-
- Untitled1.livecode.zip
- (3.88 KiB) Downloaded 387 times
Re: LC / Mobgui & Changing Input text fields on openCard
Hi Thomas,
MobGui controls are just LiveCode groups, so you should be able to manipulate them via script.
Try the following in your openCard handler
I hope this helps
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
-
MobGui controls are just LiveCode groups, so you should be able to manipulate them via script.
Try the following in your openCard handler
Code: Select all
on openCard
put "open card" into field "mgcLabel" of group "Input-1005"
end openCard
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
-
-
- VIP Livecode Opensource Backer
- Posts: 48
- Joined: Sat May 24, 2008 2:27 pm
- Location: Indiana, USA
Re: LC / Mobgui & Changing Input text fields on openCard
Thanks for the quick reply. Making that change yielded no effect. I've previously tried 'set the mgText...' as well as 'mobileControlSet ...' and now 'put xx into field...'
Would you happen to have any other ideas ? I'm trying this with MobGui 1.28 and LC 7.0x and LC 6.7.5 on the iOS Simulator 8.3
Does the attached file work for anyone ?
Would you happen to have any other ideas ? I'm trying this with MobGui 1.28 and LC 7.0x and LC 6.7.5 on the iOS Simulator 8.3
Does the attached file work for anyone ?
- Attachments
-
- Untitled 1.livecode.zip
- (3.94 KiB) Downloaded 398 times
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: LC / Mobgui & Changing Input text fields on openCard
Hi Thomas,
You have 2 on openCards in the card script.
Remove the empty one.
Simon
You have 2 on openCards in the card script.
Remove the empty one.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 48
- Joined: Sat May 24, 2008 2:27 pm
- Location: Indiana, USA
Re: LC / Mobgui & Changing Input text fields on openCard
Thanks for the reply. I've now learned that:
-) If there are multiple handlers named the same, Livecode doesn't issue an error.
-) Mobile controls aren't created before the openCard and you need to use the 'send "mobileSetup" to me in 5 milliseconds' or some such workaround.
-) In the mobileSetup handler, 'mobileControlSet...' or 'set the mgText' works but 'put ... into field ...' doesn't work.
As always, thanks for the help
-) If there are multiple handlers named the same, Livecode doesn't issue an error.
-) Mobile controls aren't created before the openCard and you need to use the 'send "mobileSetup" to me in 5 milliseconds' or some such workaround.
-) In the mobileSetup handler, 'mobileControlSet...' or 'set the mgText' works but 'put ... into field ...' doesn't work.
As always, thanks for the help