2.5.1: changes to "relation" attributes do not trigger a change event

Description

This jsfiddle, reproduces the issue I'm seeing in my website that uses the relational data layer of EnyoJS 2.5:
<http://jsfiddle.net/mephinet/0yzn1t0L/>

I have two collections (in the example "books" and "authors") that have a relation ("books.author" -> "authors"). I then attach an on-any-event-handler on the books collection: this.$.books.on("*", ...)
While this handler triggers on normal attribute's changes (e.g. the "title"), it does not trigger on a change of the relation's key (the "author").

Environment

Firefox 37.0a2

Activity

Show:
Cole Davis (Enyo Team)
January 26, 2015, 10:22 PM

Hi ,

Thanks for reporting this. Looking at your fiddle, I noticed and made 2 minor changes and got it working (according to what I think you wanted it to do). Check out http://jsfiddle.net/0yzn1t0L/3/. I changed the kind of model of Auther to enyo.RelationalModel, and set the isOwner flag of the relation to true. This causes the relation to receive changes generated from the relationship. Hope that helps!

mephinet
January 27, 2015, 8:39 PM

Thanks, Cole, for pointing me to my error - I didn't realize that both ends of the relation have to be RelationalModels, and wasn't aware of isOwner and its relevance here. Sorry for the noise!

Assignee

Screener (Enyo Team)

Reporter

mephinet

Labels

None

External issue ID

None

Tango Test Run Elements

None

Old Issue Key

None

Components

Affects versions

Priority

None
Configure