<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Nested Records in Sproutcore</title>
	<atom:link href="http://www.itsgotwhatplantscrave.com/2010/01/24/nested-records-in-sproutcore/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itsgotwhatplantscrave.com/2010/01/24/nested-records-in-sproutcore/</link>
	<description>Sproutcore and other technologies with electrolytes</description>
	<lastBuildDate>Tue, 23 Feb 2010 00:24:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Macario</title>
		<link>http://www.itsgotwhatplantscrave.com/2010/01/24/nested-records-in-sproutcore/comment-page-1/#comment-131</link>
		<dc:creator>Macario</dc:creator>
		<pubDate>Tue, 23 Feb 2010 00:24:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=212#comment-131</guid>
		<description>Hi, I am taking a lot of my work time to learn SproutCore and it promisses to be a path full of joy and sorrow. I am having really weird things going on with nested records: 

    Registration.Form = SC.Record.extend(
    {
      childRecordNamespace: Registration,
      authors:              SC.Record.toMany(&#039;Registration.User&#039;, {nested: true}),
      ...
    }

    Registration.User = SC.Record.extend(
    {
      type:                  &quot;User&quot;, 
      firstName:          SC.Record.attr(String),
      lastName:           SC.Record.attr(String)
      ...
    }

    var user = Registration.store.find(Registration.loginController); // No problem, store retrieves my user

    // First attempt:
    var form = Registration.store.createRecord(Registration.Form, {authors: []});
    form.get(&#039;authors&#039;).pushObject(user) // =&gt; Object
    form.getPath(&#039;authors.length&#039;)       // =&gt; 1
    form.get(&#039;authors&#039;).objectAt(0)      // =&gt; undefined, what??

    // Second attempt:
    var form = Registration.store.createRecord(Registration.Form, {authors: [user]});
    form.getPath(&#039;authors.length&#039;)  // =&gt; 1
    form.get(&#039;authors&#039;).objectAt(0) // =&gt; Object
    user.get(&#039;email&#039;)               // =&gt; &#039;myemail@host.com&#039;
    form.get(&#039;authors&#039;).objectAt(0).get(&#039;email&#039;) // =&gt; null, DAMN!!!

    form.getPath(&#039;authors&#039;).objectAt(0).set(&#039;email&#039;, &#039;anothermail&#039;) // =&gt; SC.Error:sc31:Internal Inconsistency (-1)
    form.get(&#039;authors&#039;).objectAt(0).set(&#039;email&#039;, &#039;ooo&#039;) // =&gt; Object
    form.get(&#039;authors&#039;).objectAt(0).get(&#039;email&#039;)  // =&gt; null, Men, I am lost!</description>
		<content:encoded><![CDATA[<p>Hi, I am taking a lot of my work time to learn SproutCore and it promisses to be a path full of joy and sorrow. I am having really weird things going on with nested records: </p>
<p>    Registration.Form = SC.Record.extend(<br />
    {<br />
      childRecordNamespace: Registration,<br />
      authors:              SC.Record.toMany(&#8216;Registration.User&#8217;, {nested: true}),<br />
      &#8230;<br />
    }</p>
<p>    Registration.User = SC.Record.extend(<br />
    {<br />
      type:                  &#8220;User&#8221;,<br />
      firstName:          SC.Record.attr(String),<br />
      lastName:           SC.Record.attr(String)<br />
      &#8230;<br />
    }</p>
<p>    var user = Registration.store.find(Registration.loginController); // No problem, store retrieves my user</p>
<p>    // First attempt:<br />
    var form = Registration.store.createRecord(Registration.Form, {authors: []});<br />
    form.get(&#8216;authors&#8217;).pushObject(user) // =&gt; Object<br />
    form.getPath(&#8216;authors.length&#8217;)       // =&gt; 1<br />
    form.get(&#8216;authors&#8217;).objectAt(0)      // =&gt; undefined, what??</p>
<p>    // Second attempt:<br />
    var form = Registration.store.createRecord(Registration.Form, {authors: [user]});<br />
    form.getPath(&#8216;authors.length&#8217;)  // =&gt; 1<br />
    form.get(&#8216;authors&#8217;).objectAt(0) // =&gt; Object<br />
    user.get(&#8216;email&#8217;)               // =&gt; &#8216;myemail@host.com&#8217;<br />
    form.get(&#8216;authors&#8217;).objectAt(0).get(&#8216;email&#8217;) // =&gt; null, DAMN!!!</p>
<p>    form.getPath(&#8216;authors&#8217;).objectAt(0).set(&#8216;email&#8217;, &#8216;anothermail&#8217;) // =&gt; SC.Error:sc31:Internal Inconsistency (-1)<br />
    form.get(&#8216;authors&#8217;).objectAt(0).set(&#8216;email&#8217;, &#8216;ooo&#8217;) // =&gt; Object<br />
    form.get(&#8216;authors&#8217;).objectAt(0).get(&#8216;email&#8217;)  // =&gt; null, Men, I am lost!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.itsgotwhatplantscrave.com/2010/01/24/nested-records-in-sproutcore/comment-page-1/#comment-119</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 16 Feb 2010 18:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=212#comment-119</guid>
		<description>Yep, its on sproutit/master</description>
		<content:encoded><![CDATA[<p>Yep, its on sproutit/master</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stevie Graham</title>
		<link>http://www.itsgotwhatplantscrave.com/2010/01/24/nested-records-in-sproutcore/comment-page-1/#comment-118</link>
		<dc:creator>Stevie Graham</dc:creator>
		<pubDate>Tue, 16 Feb 2010 17:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=212#comment-118</guid>
		<description>Has this made it into core yet? If not, anyone have a diff i can merge?</description>
		<content:encoded><![CDATA[<p>Has this made it into core yet? If not, anyone have a diff i can merge?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention It's Got What Plants Crave » Blog Archive » Nested Records in Sproutcore -- Topsy.com</title>
		<link>http://www.itsgotwhatplantscrave.com/2010/01/24/nested-records-in-sproutcore/comment-page-1/#comment-100</link>
		<dc:creator>Tweets that mention It's Got What Plants Crave » Blog Archive » Nested Records in Sproutcore -- Topsy.com</dc:creator>
		<pubDate>Mon, 25 Jan 2010 16:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=212#comment-100</guid>
		<description>[...] This post was mentioned on Twitter by Evin Grano, Erich Atlas Ocean and vikingstad, Web Developer Links. Web Developer Links said: Sproutcore: Nested Records in Sproutcore http://bit.ly/65KsgY [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Evin Grano, Erich Atlas Ocean and vikingstad, Web Developer Links. Web Developer Links said: Sproutcore: Nested Records in Sproutcore <a href="http://bit.ly/65KsgY" rel="nofollow">http://bit.ly/65KsgY</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.240 seconds -->
