On Fri, Feb 20, 2009 at 2:17 PM, Lachlan Deck <[email protected]>wrote:

> On 20/02/2009, at 4:47 PM, amiel montecillo wrote:
>
>  So I am using peer ecs. I have 2 pages. A listing page and an update page
>> to
>> display the EO.
>>
>> On the listing page, i click on an item, it takes me to the update page
>> and
>> displays the details of the EO on a ERXWOForm.
>>
>>   //listing page method
>>   public UpdatePost updatePost() {
>>       UpdatePost page = this.pageWithName(UpdatePost.class);
>>       page.setPost(this.aPost);
>>
>
> I hope you're getting a local copy of that object in the other context...


Not sure what you mean of a local copy. Inside page.setPost() is  this.post
= newPost; UpdatePost has a member object "Post"


>
>
>  I make changes and hit submit calling the update page's peer EC
>> saveChanges.
>>
>>  //update page method, execption handling ommitted for clarity
>>  public ERXComponent saveChanges() {
>>       peerEc.saveChanges();
>>       return this.pageWithName('ListingPage');
>>  }
>>
>> Could the reason be, that peer ECs cannot share EOs across different ECs
>> thus the changes are not being reflected to the DB?
>>
>
> Not sure what you mean by this. ECs don't share (shared ec is an
> exception). You must get a localised copy of the objects into the other
> context.
>

What I mean is, in PeerEC1, i made changes to the object, the changes are
not seen in PeerEC2 thus calling PeerEC2.saveChanges() does not contain
changes in the object right?

I tried to do this in PeerEC2 (this is a bad hack):

Post p = Post.localInstanceIn(PeerEC2, this.post);
p.setSomething(this.post.something());
PeerEC2.saveChanges(); <-- this actually reflects the changes to the DB.


What could be a better route?

(Sorry for so many questions, i'm still trying to learn the ropes, I do
appreciate your replies.)


>
> with regards,
> --
>
> Lachlan Deck
>
>
>
Thanks,
Amiel

-- 
socket error: unable to connect to 127.0.0.1
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to