facebook

Database Example (insert / delete / list / search)

  1. MobiOne Archive
  2.  > 
  3. Feedback & Suggestions
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #323337 Reply

    Dear Wayne,
    my name is Renato Gaui Filho, live in Brazil and I’m a system developer using delphi language with MS SQLServer database.
    First of all, I want to congratulate you and your dev team for your very good software (nice interface, easy to use and friendly).
    I made the trial download of mobione tree weeks ago, started to use and after 2 hours loved it (after the webinar I purchased it).
    But I need to build a database application nut I don’t know. I already search the FAQ and HOW-TO-DO but I didn’t find nothing about it.
    Please, I would like to suggest you to give us an example of an application like the Contac List, with database manipulation, where the user can insert, delete (with the red rectangle), list and search records.
    If you or someone has an example of an applicatin like this, please, will be very welcome.
    Hoping hear from you as soon as possible I thank you.
    Best regards,
    Renato

    #323345 Reply

    Albatros78
    Participant

    Hello Renato,

    I posted this article long ago:

    http://www.genuitec.com/support-genuitec/viewtopic.php?f=8&t=1037

    Hope this helps and welcome in this MB1 users forum… You’re welcome

    #323362 Reply

    Hi Wayne,
    I downloaded the example but when I open the “sample_db.mobi” and run at Test Center nothing happens.
    All the buttons (Create Db / Create Table / Add 1 record / Delete Table) does not have any Actions at the On Click !
    Please, could you try it and help me ?
    Thanks,
    Renato

    #323364 Reply

    Albatros78
    Participant

    Hello Renato,

    Here a new zipped file wich works fine.
    to see th DB into tescenter, click on th black arrow on the right to enlarge the window. Click on Tool menu and Local Storgae to see DB, table and records.

    Wayne, during the upgrade of .mobi file to 1.4.1 all JS calling functionds into the design have been removed !!!!

    Regards

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

    support-michael
    Keymaster

    @Renato

    Please note that this example is a user contribution (Albatros78) which we greatly appreciate. But it is not officially supported.

    I’ll come clean on why I have not provided a comprehensive webdb example. Not wanting to come off sounding obstinate it is a matter of ROI and higher priority commitments:

    1) the webdb spec has been deprecated and is no longer part of HTML5. I was keen on webdb when it was part of the HTML5 spec. But as we expand mobione across platforms other than iOS a non-standard feature will become an compatibility and support issue

    Here is spec with deprecation notice http://www.w3.org/TR/webdatabase/

    2) the investment in creating, doc’ing and then supporting the many “look at my sql problem…” questions for an ad hoc mechanism that is not guaranteed to be around and consistent across platforms automatically lowers its priority relative to the many mobione specific questions we receive.

    Personally, a I plan to create an iOS example (with not part of HTML disclaimer) as time permits. In the meantime perhaps Albtros’ example can be updated or a quick google search will provide a bunch of hits for webdb examples that can be adapted and integrate with a mobione UI.

    #323367 Reply

    Dears Albatros and Wayne,
    I already executed the new “Sample DB OK MB1 1.4.1” and runned fine at Test Center.
    Thanks for the help !
    Best regards,
    Renato

    #323369 Reply

    support-vadim
    Participant

    Hi Albatros78,

    > Wayne, during the upgrade of .mobi file to 1.4.1 all JS calling functionds into the design have been removed !!!!
    Could you please give us scenario to reproduce that? I wasn’t able to find scenario by my own.

    Regards,

    Vadim Ridosh

    #323371 Reply

    Albatros78
    Participant

    Hi Vadim,

    Download the previous code (viewtopic.php?f=8&t=1037)
    and try to open it with MB 1.4.1
    Choose update .mobi file.

    All Action by JS on button action are not upgraded…
    All actions are initiliazed at “none”. It’w why the project did not work for Renato with my initial files

    Hope this helps

    #323373 Reply

    Albatros78
    Participant

    Vadim

    Just a simple checking into my previous mobi project coded with previous version of MB1
    Into .mobi file for examplel to init the DB the JS script function is :

    <Property name=”Link” type=”com.genuitec.mobione.designer.comp.iphone.links.Link” editor=”org.netbeans.modules.form.editors2.LinkEditor”>
    <Link urlPath=”ext:javascript:initDB()”/>
    </Property>

    And during the update with 1.4.1 JS function initDB() is not initialized into the GUI

    Hope this helps

    #323405 Reply

    support-vadim
    Participant

    Hi Albatros78,

    We’re able to reproduce the problem and working on it now.
    Thanks for the info you provided.

    Regards,
    Vadim Ridosh

    #323411 Reply

    Dears Wayne and Albatros,
    I’m building my beta database application, based at the example that you give me, but I still need some help.

    1. How initialize automatically a database (Sample_DB) that have been created, without press any button.

    2. How UPDATE a record (I made this function but doesn’t work)

    function UpdateLine()
    {

    Tbl = document.getElementById(“m1-Sample_DB-table”).value;
    MyTable = Tbl;
    Nome = document.getElementById(“m1-Sample_DB-nome”).value;

    db.transaction(function(tx) {
    tx.executeSql(“UPDATE ” + MyTable + ” WHERE firstname = ‘” + Nome + “‘” +
    ” SET lastname = ‘XXX'”
    ,function(tx,result) {
    },function(tx,Error) {});

    alert(‘1 record updated into Table ‘ + MyTable);

    }
    )}

    3. How DELETE a record (I made this function but doesn’t work)

    function DelLine()
    {

    Tbl = document.getElementById(“m1-Sample_DB-table”).value;
    MyTable = Tbl;
    Nome = document.getElementById(“m1-Sample_DB-nome”).value;

    db.transaction(function(tx) {
    tx.executeSql(“DELETE FROM ” + MyTable + ” WHERE firstname = ‘” + Nome + “‘”,function(tx,result) {
    },function(tx,Error) {});

    alert(‘1 record deleted into Table ‘ + MyTable);

    }
    )}

    4. How SEARCH a specific record (I tried SELECT but doesn’t work)

    function SearchLine()
    {

    Tbl = document.getElementById(“m1-Sample_DB-table”).value;
    MyTable = Tbl;
    Nome = document.getElementById(“m1-Sample_DB-nome”).value;

    db.transaction(function(tx) {
    tx.executeSql(“SELECT FROM ” + MyTable + ” WHERE firstname = ‘” + Nome + “‘”,function(tx,result) {
    },function(tx,Error) {});

    alert(‘1 record seleted into Table ‘ + MyTable);

    }
    )}

    5. How fill a list of itens or combobox with the result of a SELECT ALL.

    6. How make/use gestures (Ex.: moving the finger to right) to appear the RED DELETE button (like many applications).

    Please, any examples/instructions/tips/statements/… will be very welcome.

    Thanks you very much for the attention and help !

    Best regards,
    Renato

    #323686 Reply

    Albatros78
    Participant

    Hello Wayne,

    If the webdb spec are not supported by HTML5 what are the function available to continue to work with local db ?

    Thanks
    Axel

    #323688 Reply

    support-michael
    Keymaster

    @Albatros78

    >If the webdb spec are not supported by HTML5 what are the function available to continue to work with local db ?

    Great question. Web Storage (localStorage/sessionStorage) is the valid HTML5 spec, atm.

    Here are some resources:
    HTML compatibility chart
    Web Storage spec
    Local Storage Example
    Local Storage Discussion

    #323690 Reply

    Albatros78
    Participant

    thks for your quick reply

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: Database Example (insert / delete / list / search)

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