Welcome Guest Search | Active Topics | Members | Log In | Register

Lazy loading problem Options · View
jesse
Posted: Monday, November 14, 2011 11:55:01 AM
Rank: Newbie Coder
Groups: Member

Joined: 11/14/2011
Posts: 3
Points: 9
Location: boston
Hi,

How to load related table information using weborb in flex.

I did now is :

I had twe tables : form_has_answer and answer.

On flex side I had code:
var findOptions:Object = new Object();
findOptions.LoadRelations = [ "Relatedanswer" ];
var temp:ActiveCollection = ActiveRecords.Form_has_answer.findAll(findOptions);

But in temp collection, all the answers' value are not loaded.

Thanks
Mark Piller
Posted: Wednesday, November 16, 2011 10:54:34 AM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
Preloading of related records works only in the direction from table with Primary Key to the table with the Foreign Key. Is this how form_has_answer and answer are related to each other?

Mark

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
jesse
Posted: Wednesday, November 16, 2011 12:10:24 PM
Rank: Newbie Coder
Groups: Member

Joined: 11/14/2011
Posts: 3
Points: 9
Location: boston
Yes, form_has_answer has answerid as a foreign key and they are one to many relationship.
Mark Piller
Posted: Wednesday, November 16, 2011 1:29:58 PM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
In this case, the preloading will work when you load form_has_answer from answer. The code for preloading is included into the generated code. Do you use Java, .NET or PHP?

Mark

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
jesse
Posted: Friday, November 18, 2011 9:49:09 AM
Rank: Newbie Coder
Groups: Member

Joined: 11/14/2011
Posts: 3
Points: 9
Location: boston
Hi Mark,

Thanks for your quick reply.

I am using Java on the server and flex on the client. The issue is the this way sometime will preload related object, but sometime it doesn't.

Do you have any consistant way to reload related objects?

Thanks
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.126 seconds.