• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WODisplayGroup and insert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WODisplayGroup and insert


  • Subject: Re: WODisplayGroup and insert
  • From: Daniel Muller <email@hidden>
  • Date: Mon, 6 Jan 2003 11:26:54 +0100

Use the insertion functions found in the WODisplayGroup class as:

    public void insertObjectAtIndex(Object createObject, int newIndex)

otherwise you have to manually refetch your objects.

Hope this helps,
Daniel
--

On 06.01.2003, at 11:07, Antonio Moro wrote:

I've build two component, the first for listing products and the second to
insert/edit a product.
The list is a WODisplayGroup and when I insert a new product and save it, the
WODisplayGroup dosen't update.
Then if I recall the list from the Main component I can see the new product.


My code for the new product action in list component is:

    public DetailProductPage newRecord() {
        DetailProductPage nextPage =
(DetailProductPage)pageWithName("DetailProductPage");

        // Initialize your component here
        EOEditingContext ec = this.session().defaultEditingContext();
        product = new Product();
        ec.insertObject( product );
        nextPage.setProduct( product );
        nextPage.setBackComponent( this );

        return nextPage;
    }

the code in detail component for save changes is:

    public WOComponent saveRecord() {
        EOEditingContext ec = this.session().defaultEditingContext();
        ec.saveChanges();

        return backComponent();
    }
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >WODisplayGroup and insert (From: "Antonio Moro" <email@hidden>)

  • Prev by Date: WODisplayGroup and insert
  • Next by Date: Re: Accessing Database
  • Previous by thread: WODisplayGroup and insert
  • Next by thread: EOModel Many-To-Many Not Sychronising In myApplication
  • Index(es):
    • Date
    • Thread