• 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
WG: [still newbie] How to redisplay correctly a WODisplayGroup afterdeleting an EO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WG: [still newbie] How to redisplay correctly a WODisplayGroup afterdeleting an EO


  • Subject: WG: [still newbie] How to redisplay correctly a WODisplayGroup afterdeleting an EO
  • From: "Thomas Engeroff" <email@hidden>
  • Date: Sun, 10 Oct 2004 22:58:30 +0200

Title: Re: [still newbie] How to redisplay correctly a WODisplayGroup afterdeleting an EO

Hi Erwin,

 

what I usually do is call myDisplayGroup.qualifyDataSource();

This causes the displygroup to refetch and therefore you get rid of deleted EO’s.

Hope this works for you.

 

Regards,

Thomas

 


Von: webobjects-dev-bounces+thengeroff=email@hidden [mailto:webobjects-dev-bounces+thengeroff=email@hidden] Im Auftrag von WebObjects
Gesendet: Sonntag, 10. Oktober 2004 16:26
An: WebObjects (Group)
Betreff: Re: [still newbie] How to redisplay correctly a WODisplayGroup afterdeleting an EO

 

Erwin,

This may be what you are looking for to ‘flush’ out the old recordset and request a new one on reloading the page (force a fresh fetch).

session().defaultEditingContext().invalidateAllObjects();

Regards,

-Bill


on 10/10/04 07:55, Erwin at email@hidden wrote:

sorry, could not find any hint in archives...
In my "ListContactPage", I display a list of Agent's contact entities in a WODisplayGroup (master "Agent"-  details "contacts")  works fine...   (with 'fetches on load' option selected )
    public ListContactPage(WOContext context) {
        super(context);
        this.takeValueForKeyPath(((Session) session()).agent(), "agentContactDisplayGroup.masterObject");
    }
.........
then I select one contact to view the contact info in a "ContactDetailPage"
    public WOComponent viewContactInfo(){  
        ContactDetailPage nextPage = (ContactDetailPage)pageWithName("ContactDetailPage");
        nextPage.setTheContact(aContact);
        return nextPage;
    }
 
In my "ContactDetailPage" I can delete the displayed contact
    public void setTheContact(EOEnterpriseObject aContact){
        theContact = aContact;
    }
 
    public ListContactPage deleteContact(){
        Agent contactAgent = ((Contact) theContact).agent();
        contactAgent.removeObjectFromBothSidesOfRelationshipWithKey(theContact,"contacts");
        EOEditingContext ec = session().defaultEditingContext();
        try {
            ec.deleteObject(theContact);
            ec.saveChanges();
        } catch (Exception e) {
            ec.revert();
            NSLog.err.appendln("An exception occurred while trying to remove a contact: " + e);
        }
         ListContactPage nextPage = (ListContactPage)pageWithName("ListContactPage");
           return nextPage;
    }
But  when the ListContactPage redisplay, the deletec contact is still in the WODisplayGroup...  i know it has been deleted from the database .... (if I restart the woapp, I don't get it anymore in teh WODisplayGroup...
si it seems to be a problem of doing a new fetch from the database, WODisplayGroup should do it itself on reload... ,,
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.concyse.com/
______________________________________________________________________


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: RE: Bug in Freeze Component...??...on OS X 10.3.5..
  • Next by Date: Re: Constructing Fetch Syntax
  • Previous by thread: Re: Windows XP Sp2 and http Adaptor [solved]
  • Next by thread: Need help with using ERJavaMail in Project Wonder
  • Index(es):
    • Date
    • Thread