facebook

Go to Screen not working after database and table creation

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #328886 Reply

    ssquire
    Member

    Using a listItem I call a function to create a database in SQLite. In the first line I obtain the database name using the prompt(“”) alert dialog box. I go on and create the database using the following code segment (Note: the database and table creation use your Sample_DB.mobi example).

    try {
    if (window.openDatabase) {
    dName = finalDBName;
    db = openDatabase(dName, “1.0”, “”, 100000);

    //Automatically create a table to enter game notes.
    createTable();

    As you also can see, I immediately create a Table after the database is created (again, see your example). After the database and table are created I click on another listItem which performs a “Go to Screen” and the new screen contains items that will be added to the database table. The only problem is, it never goes to the screen. The listItem remains selected and the screen never appears in the emulator.

    Now, if I click on the listItem that performs the “Go To Screen” before the database and table creation – it will transition to the screen. But if I create the database and table first the “GoToScreen” does not work.

    The only difference in my code and your example from “Sample_DB_custom.js” is the fact that I use the alert box prompt to obtain the database name and run the javascript code to add a line to the database from another screen’s pushbutton selection, and your example uses a textField and pushbutton from the same screen.

    I would appreciate some help if possible. I have attached the relevant “…_custom.js” file.

    #328958 Reply

    Max87
    Member

    Hi ssquire,
    I’ll try to look at this, I work with local database with no problem, so it’s interesting for me why it’s not working for you.
    Give me some time. I’ll post my reply asap.

    edit: I tried to create base empty screen with two buttons and linked screen2.mobi, one button fires makeNewDB(), second button fires addLine().
    Then I tried to add to addLine() phoneui.gotoPage(‘#m1-screen2’,phoneui.transitions.slideLeft)
    In this state, It creates database named via prompt dialog, when I click second button, inserts one entry to table and transfers me to scren2.
    Can you please share your mobi files, so I can look into your files and try to solve your problem?
    Thx.

    #329008 Reply

    ssquire
    Member

    Sorry Max87. I am trying to get you the files, but it is severely limiting the size of my attachments. I tried to zip the whole project, which was 10M and it said the max size was 8M. Then when I removed irrelevant files and got it to 3M it said the max size was 500KiB. I’ve attached what I could. Maybe Octavio can help me out if he sees this post.

    Even stripped down the first file was 701kB. You should be able to easily create it though, it just calls GameNotes.mobi.

    Attachments:
    You must be logged in to view attached files.
    #329024 Reply

    Hi ssquire,

    Could you send us your files to support at genuitec dot com? Then I can try to take a look this weekend.

    #329032 Reply

    Max87
    Member

    Hi ssquire,
    I’ve tried your example, and it’s interesting.
    I created Link to AddGameNotes and it’s working OK before database is created. When I create database, Link and List Item are not working.
    I’ve tried to replicate your scenario to iPhone design and with small tweaks it’s working fine(function for add line to database is called addLine not AddLine as in mobi).
    So I think there is a bug with Android emulation in Test Center.
    Interesting thing also is, that when I enter some name to prompt dialog(f.e aaa), Test center creates two databases – my aaa and empty named null. In iPhone design it creates aaa only.

    #329052 Reply

    ssquire
    Member

    Max87,
    You are obviously seeing exactly what I am seeing. Bravo! I am a career software test engineer. I thought something was wrong. I’ll use a workaround until you guys find a fix.

    Thx!

    #329068 Reply

    Max87
    Member

    Hi ssquire,
    I’m glad to know, that I help you 🙂
    I hope that guys from support will fix this bug soon and you can develop your app.

    #329086 Reply

    ssquire
    Member

    Octavio,
    Do you have enough of my files to recreate the bug? If you need more tell me how to send larger files.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Go to Screen not working after database and table creation

You must be logged in to post in the forum log in