Lesson 3 challenges

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

Post Reply
DataDude
Posts: 7
Joined: Tue Mar 11, 2014 6:06 pm

Lesson 3 challenges

Post by DataDude » Tue Apr 08, 2014 10:14 pm

Having 2 issues on lesson 3. Doing it in LC 6.6 with the new MobGUI. I know running behind.

Issue 1 - Making the SQLite button the default.
Doesn't seem to have the default property in the new MobGUI. Is there another way to do this?

Issue 2 - Making SQLite work in the simulator.
My SQLite functionality when I select that button works perfectly when I test it in LC on OSX. But when I try it in the simulator I get the error
"revdberr,Database Error: Undefined SQLite error
Query: SELECT firstname, lastname, contact_id FROM contacts"
I have the contacts.sqlite file in Copy Files in stand alone setting and I am have both SQLite and MySQL selected in the externals on the iOS page.
Any ideas what to look at to debug this one?

Thanks,
Tim G

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Lesson 3 challenges

Post by LCNeil » Wed Apr 09, 2014 10:34 am

Hi Tim,

I'm not sure there is a default property for mobGui buttons but it might be worth asking the developer this in the dedicated mobGui forum-

http://forums.runrev.com/viewforum.php?f=54

If its not present, then he may be able to integrate it in a future revision of the product.

There are someways that I have come accross that make a button default. Theses are-

1) Save you stack with the button you want default selected. When the stack is opened or a standalone is built and run, this button will always be selected first

2) Via script- It is possible to trigger a mobGui button via script, so the following on the openCard script might work. You can change the button(group) name to anything you want

Code: Select all

on openCard
send mouseDown to group "Direct MySQL"
send mouseUp to group "Direct MySQL" 
end open card

The mouseDown hilite the button and the mouseUp triggers it

For the SQLite error, it would be great if you could supply your stack and the version of LiveCode you are using for us to test as if it is working within the IDE, then it should work in the simulator.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

DataDude
Posts: 7
Joined: Tue Mar 11, 2014 6:06 pm

Re: Lesson 3 challenges

Post by DataDude » Wed Apr 09, 2014 8:53 pm

Thanks for the advise on approaches to making the MobGUI button act as a default. I did the script on openCard and it worked perfectly.

Have attached my LC stack. I am using LC 6.6.0 build 4003 commercial version and newest MobGUI. Any help appreciated.

I also noticed that the MobGUI native input box is only functional in the simulator. I can't seem to find a way to get it to function in the IDE and that sort of makes sense as it is calling a mobile native.

Thanks for any help on this.

Tim G
Attachments
SchoolApp_Tim.zip
(23.04 KiB) Downloaded 333 times

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Lesson 3 challenges

Post by LCNeil » Thu Apr 10, 2014 10:57 am

Hi Tim,

Thanks for supplying your stack

I've tested it on my iOS sim, and it seems to work perfectly with no error being returned. Please see the following video of your stack working on my sim-

http://techsupport.on-rev.com/tim.zip

A reason that it might not be working for you is if you deployed your stack, prior to including the contacts.sqlite database file. If this was not included, then revOpenDatabase will create a blank database when called.

I would recommend resetting your iOS sim to default settings (from withing sim iOS simulator--->Reset contents and settings) and then trying to deploy again. Deleting the app manually and re-deploying should have the same effect (long press the app icon in the simulator and press the small "x" to delete")

In regards to the native input box, the new mobGui only creates this as a native mobile control so it will not be functional in the LiveCode IDE. The developer is aware of this issue and is considering integrating the desktop field support that was present in previous mbGui versions. More information on this can be found here-

http://forums.runrev.com/viewtopic.php?f=54&t=19701

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

DataDude
Posts: 7
Joined: Tue Mar 11, 2014 6:06 pm

Re: Lesson 3 challenges

Post by DataDude » Thu Apr 10, 2014 9:37 pm

Thanks Neil,

You are correct that I deployed the app in the simulator and deleting it from the simulator did the job. Next test worked perfect. Good to know that it is sometimes necessary to do this.

I did see where the developer of MobGUI posted about possibly including desktop support for the fields. Hope he does as it would be very convenient.

Thanks again,
Tim G

Post Reply

Return to “idea2app and Coding School”