|
|
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
|
|
 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: midnightcoderblog: blog.themidnightcoders.comwebsite: www.themidnightcoders.com
|
|
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.
|
|
 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: midnightcoderblog: blog.themidnightcoders.comwebsite: www.themidnightcoders.com
|
|
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
|
|
|
Guest |