- This topic has 11 replies, 8 voices, and was last updated 12 years, 2 months ago by aklisiewicz.
-
AuthorPosts
-
Albatros78ParticipantWayne,
I would like to post this item into How to section, but not possible to send attached files …. Grrrrr !!!
Here the main subject o this item:
Hi Guys,
I posted here my sample of “How to create a local db storage with Mb1” !!!
Thanks Wayne for your help about JS calling function, sometimes not too clear with not doucmentation 🙂
2 words:
——–
1)
This zipped file include 2 directories. One for Native Web browsers into html5, and second which is my mb1 application.
You can use the HTML5 project with Firefox and Chrome (look at my post at http://www.genuitec.com/support-mobione/viewtopic.php?f=14&t=1036 about how to use Chrome debugger… very nice.
Not tested with IE from my side…The second project is for your mb1 software (v1.0m9u4). It works perfectly into the simulator. Open the test center on the right to check the local storage and use the application.
You can create DB, Table, Records…Etc….and see all of them into the live window on the right
2)
Wayne,
There is one bug from mb1 in this example (commented ..)
Look at my Sample_DB_custom js file. I have commented at the beginning the bug. I call a function inside another one. I don’t know if it the bug reason, but try it into test center like is explained at item 1, and you can see by yourself that test center not functionnal as explained into my js file
Any feedback from you side will be nice to undertand this bug reason !Hope this helps
Enjoy guys ….
Attachments:
You must be logged in to view attached files.
skashiMemberHi Albatros78
Thanks for your post. It was very helpful.
In response to your bug in your mb1 code your function is called as such:
AutoCreateTable();And it should just be like this:
autoCreateTable();Hope this helps
Skashi
Albatros78ParticipantHi skashi
You’re welcome !
Hope this sample was effective for you.
Thanks for your comment about the bug. in fact not really bug but just bad wording of function name.
I will do better next time 🙂
Albatros78ParticipantHello Wayne,
I just checked fix solution from skashi
and it works. fine !But 2 things:
– The call function must be spelled autoCreateTable() and not AutoCreateTable()
AND the function name also MUST BE autoCreateTabel and not AutoCreateTable– Why the function name cannot be speeled with an uppercase letter ? Bug ?
shadowMemberHi everybody!
i tried to use your stuff and all is working good when I try to create the db, the tabel and the fields but unfortunately it doesn’t save my job and when I leave MobiOne and re-enter, I can’t see the db…is it normal?
Thanks,
Shadow
Albatros78ParticipantHello Shadow,
Normally the db and table are always created, even if you leave emulator.
Just somes infos to help you.
Run gain my sample.
– Create a DB “demo1”
– Create a table “Table1”
– and click twice to add 2 records. Normall the “John Travolta” record will be added twice, into your tableLeave MobiOne Emulator and design
Modify by hand the Sample_DB_custom.js file and change the line
tx.executeSql(“INSERT INTO ” + MyTable + ” (firstname,lastname,phone,email) VALUES (?,?,?,?) “,[‘Travolta’,’John’,’0102030405′,’john@travolta.net’],function(tx,result)
by a new one like:
tx.executeSql(“INSERT INTO ” + MyTable + ” (firstname,lastname,phone,email) VALUES (?,?,?,?) “,[‘Albatros’,’test’,’0102030405′,’john@travolta.net’],function(tx,result)
and:
– Create again a DB with SAME name
– Create a table with SAME name.Click add record.
Normally your db will be populate with the previous records and also new one
Hope this helps
exstyleMemberHello,
how can I put the database in my template?
Greets Timur
support-michaelKeymaster@exstyle
The current template model is limited to only design files, not custom javascript code. We are working on a more advanced template model that will provide more advanced support such as creation of multiple pages with custom actions. That is still a couple of months away.
Ravikant83MemberHello,
I am new with MobiOne. how can we populate records as list on iphone from table? can we use search filter in record selection?
Thanks
Ravikant
Max87MemberHi guys,
how to work with database on several pages?
I’d like to create database while main page is loading(this works), on another page I have a button, when is clicked calls function which saves values from text fields from that page(not working).
The code is in main_custom.js.
Max87MemberThanks Octavio. Have you ETA for example 🙂 ?
aklisiewiczMember@Albatros78 wrote:
Wayne,
I would like to post this item into How to section, but not possible to send attached files …. Grrrrr !!!
Here the main subject o this item:
Hi Guys,
I posted here my sample of “How to create a local db storage with Mb1” !!!
Thanks Wayne for your help about JS calling function, sometimes not too clear with not doucmentation 🙂
2 words:
——–
1)
This zipped file include 2 directories. One for Native Web browsers into html5, and second which is my mb1 application.
You can use the HTML5 project with Firefox and Chrome (look at my post at http://www.genuitec.com/support-mobione/viewtopic.php?f=14&t=1036 about how to use Chrome debugger… very nice.
Not tested with IE from my side…The second project is for your mb1 software (v1.0m9u4). It works perfectly into the simulator. Open the test center on the right to check the local storage and use the application.
Enjoy guys ….
is this WWebSQL or SQLite ?
Arthur -
AuthorPosts