Home > AIR 1.5, Action Script 3, Flex 3 > Some modifications on Christophe Coenraets ORM Example

Some modifications on Christophe Coenraets ORM Example

February 10th, 2009

In addition to Christophe Coenraets article “Using the SQLite Database Access API in AIR Part 3″ I made some modifications to enable inline editing and update the grid imidiately after every data change.


import mx.events.DataGridEvent;
private var em:EntityManager = EntityManager.getInstance();

public function saveItem():void
{
    em.save(contact);
    parentApplication.loadContacts();
}

public function saveItemInline(event:DataGridEvent):void
{
    var field:String = event.dataField;
    contact[field] =   event.currentTarget.itemEditorInstance.text;
    em.save(contact);
}

public function deleteItem():void
{
    em.remove(contact);
    parentApplication.loadContacts();
}

public function newItem():void
{
    contact = new Contact();
}
If you found this useful, leave a comment...I love comments :-).

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • E-mail this story to a friend!
  • Print this article!
  • Spurl
  • StumbleUpon
  • Technorati

stevie AIR 1.5, Action Script 3, Flex 3 , , , , , ,

  1. Odo
    February 11th, 2009 at 20:14 | #1

    Hi Stevie,

    my changes are more in the EntityManager code. I will setup a google code project, clean up my code and commit everything. I sorry that i have so less time.

  2. stevie
    February 11th, 2009 at 21:11 | #2

    Hi Odo,

    I think this is a good Idea and will follow up :-). Please let me know if the google code page is available.

    c u st.

  3. Jonathan
    March 31st, 2009 at 06:45 | #3

    I am interested in this project also. I think building ontop of this will be very interesting.

  4. wow
    April 22nd, 2009 at 10:24 | #4

    this is exactly the post I needed to see!

  5. wow
    June 10th, 2009 at 04:05 | #5

    Great article. Thanks for the great resource.

  6. Jeroen
    July 6th, 2009 at 12:23 | #6

    Hi Stevie

    This might be a longshot…I am trying to insert everything into a datagrid, are there any examples out there with this type of approach

  7. stevie
    July 6th, 2009 at 14:23 | #7

    @Jeroen
    Hi, I did it with my rss reader ( http://werth.psycholutions.com/latest-project ) Unfortunately that code is’nt public ;-). Meanwhile there could be some more resources…I would test a google search.

  8. Jeroen
    July 6th, 2009 at 16:05 | #8

    @ Stevie I did do a public search on google and come up with nothing..it seems to be like hens teeth trying to find a example on this particular topic.

  9. James Devlin
    November 21st, 2009 at 06:53 | #9

    Well, to soon to say if it’s good, but at least it’s well designed.
    I mean I thought I would be blocked after adding some interests, but the site helps you to add more.
    Cheers

  10. Klaus W.
    November 23rd, 2009 at 07:48 | #10

    Great article, again. These informations are especially useful …

  1. No trackbacks yet.