<?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 for It&#039;s Got What Plants Crave</title>
	<atom:link href="http://www.itsgotwhatplantscrave.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itsgotwhatplantscrave.com</link>
	<description>Sproutcore and other technologies with electrolytes</description>
	<lastBuildDate>Tue, 23 Feb 2010 00:24:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Nested Records in Sproutcore 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>Comment on Nested Records in Sproutcore 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>Comment on Nested Records in Sproutcore 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>Comment on Basic View API (part 2) by Ido Ran</title>
		<link>http://www.itsgotwhatplantscrave.com/2009/08/23/basic-view-api-part-2/comment-page-1/#comment-103</link>
		<dc:creator>Ido Ran</dc:creator>
		<pubDate>Tue, 26 Jan 2010 18:55:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=183#comment-103</guid>
		<description>Hi,
Thanks for the great posts.
I have one thing I really want to know and I think can complete this two posts: how to use the new custom view in a collection view - that is ListView and GridView.

I am trying to recreate the photos application using Sproutcore 1.0.
In that application I would like to show the photos grid using a custom view that I will create and to use it as exampleView of the GridView. The problem is that I can&#039;t figure out how to bind each photo model item to the custom view created by the grid.

Thank you,
Ido.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for the great posts.<br />
I have one thing I really want to know and I think can complete this two posts: how to use the new custom view in a collection view &#8211; that is ListView and GridView.</p>
<p>I am trying to recreate the photos application using Sproutcore 1.0.<br />
In that application I would like to show the photos grid using a custom view that I will create and to use it as exampleView of the GridView. The problem is that I can&#8217;t figure out how to bind each photo model item to the custom view created by the grid.</p>
<p>Thank you,<br />
Ido.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Nested Records in Sproutcore 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>
	<item>
		<title>Comment on Building Sproutcore Apps with Statecharts (part 1) by Larry Siden</title>
		<link>http://www.itsgotwhatplantscrave.com/2009/02/22/building-sproutcore-apps-with-statecharts-part-1/comment-page-1/#comment-98</link>
		<dc:creator>Larry Siden</dc:creator>
		<pubDate>Thu, 21 Jan 2010 18:59:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=63#comment-98</guid>
		<description>I had the honor of hearing D. Harel talk about state-charts back in the early &#039;80s at our regular symposium when I was a grad-student at the Hebrew U. of Jerusalem.  I was quite impressed even then.  This example w/ login is example what I need for the next stage of my app development and I plan to use it!  Thank you, Erich O.!</description>
		<content:encoded><![CDATA[<p>I had the honor of hearing D. Harel talk about state-charts back in the early &#8217;80s at our regular symposium when I was a grad-student at the Hebrew U. of Jerusalem.  I was quite impressed even then.  This example w/ login is example what I need for the next stage of my app development and I plan to use it!  Thank you, Erich O.!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building Sproutcore Apps with Statecharts (part 1) by Evin</title>
		<link>http://www.itsgotwhatplantscrave.com/2009/02/22/building-sproutcore-apps-with-statecharts-part-1/comment-page-1/#comment-97</link>
		<dc:creator>Evin</dc:creator>
		<pubDate>Fri, 15 Jan 2010 18:26:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=63#comment-97</guid>
		<description>@Kristian

If you are going to do a very simple straight forward application it is probably better to use the rootresponders like in /sproutcore/apps/tests/states...

The implementation that I used and wrote about is for most complex applications that need to keep track of parallel states, history states and complex substates.
Looks like you have a good grasp of what is going on in the state charts... it is really hard to understand what to do until you start to actually code an app with a state chart.   The idea is all &#039;actions&#039; take place on the global application namespace.  So in your application if you have a &#039;target&#039; and &#039;action&#039;. ie Buttons, dropdowns etc that trigger events on you app.  Then you are able to sort out based off of where you are on the application (state) to trigger events or processes.

if you would like, I can set up a web meeting to show you some advanced stuff with state charts that we are doing...jsut send me an email.

Evin (etgryphon)</description>
		<content:encoded><![CDATA[<p>@Kristian</p>
<p>If you are going to do a very simple straight forward application it is probably better to use the rootresponders like in /sproutcore/apps/tests/states&#8230;</p>
<p>The implementation that I used and wrote about is for most complex applications that need to keep track of parallel states, history states and complex substates.<br />
Looks like you have a good grasp of what is going on in the state charts&#8230; it is really hard to understand what to do until you start to actually code an app with a state chart.   The idea is all &#8216;actions&#8217; take place on the global application namespace.  So in your application if you have a &#8216;target&#8217; and &#8216;action&#8217;. ie Buttons, dropdowns etc that trigger events on you app.  Then you are able to sort out based off of where you are on the application (state) to trigger events or processes.</p>
<p>if you would like, I can set up a web meeting to show you some advanced stuff with state charts that we are doing&#8230;jsut send me an email.</p>
<p>Evin (etgryphon)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building Sproutcore Apps with Statecharts (part 1) by Kristian Mandrup</title>
		<link>http://www.itsgotwhatplantscrave.com/2009/02/22/building-sproutcore-apps-with-statecharts-part-1/comment-page-1/#comment-96</link>
		<dc:creator>Kristian Mandrup</dc:creator>
		<pubDate>Fri, 15 Jan 2010 12:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=63#comment-96</guid>
		<description>Hi Evin, Nice article! :) But it was pretty hard (even after reading the 2nd part) to understand how to use it in a real life app.

After browsing through the code, this is how I understand it.

main.js
--------
main() {
 // set initial state of application
 ContactsTool.goState(&#039;a&#039;,1);
}

core.js
-------

ContactsTool StateChart object initialized here, contains function for each app. state (as per statechart diagram)

// ContactsTool.goState(&#039;a&#039;,1); becomes a call to state handler function ContactsTool.goStateA1
// the initial login screen is loaded (see login.js)
goStateA1: function() {
 //login screen
 this.set(&#039;mainView&#039;, &#039;ContactsTool.loginPage.mainView&#039;);
}

login.js
--------
Custom page is created with a button. Clicking the button results in the action &#039;submitLogin&#039; on the target ContactsToll (StateChart)
Thus the StatChart will handle this action

Back in core.js
----------------
//core actions

submitLogin: function() {
  var handled = NO;

  switch(this.state.a){
      // if I came from state A1 (initial login screen)   
      case 1:
        // I will go to state A2
        this.goState(&#039;a&#039;,2);
        handled = YES;
        break;
  }
  // error! I shouldn&#039;t end up here. Only valid entry point is from initial login screen!
  if(!handled) console.log(&#039;ContactsTool#submitLogin Action not handled in state %@[%@]&#039;.fmt(&#039;a&#039;,this.state.a));

--
and so on from here... :) 

Any comments?</description>
		<content:encoded><![CDATA[<p>Hi Evin, Nice article! <img src='http://www.itsgotwhatplantscrave.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But it was pretty hard (even after reading the 2nd part) to understand how to use it in a real life app.</p>
<p>After browsing through the code, this is how I understand it.</p>
<p>main.js<br />
&#8212;&#8212;&#8211;<br />
main() {<br />
 // set initial state of application<br />
 ContactsTool.goState(&#8216;a&#8217;,1);<br />
}</p>
<p>core.js<br />
&#8212;&#8212;-</p>
<p>ContactsTool StateChart object initialized here, contains function for each app. state (as per statechart diagram)</p>
<p>// ContactsTool.goState(&#8216;a&#8217;,1); becomes a call to state handler function ContactsTool.goStateA1<br />
// the initial login screen is loaded (see login.js)<br />
goStateA1: function() {<br />
 //login screen<br />
 this.set(&#8216;mainView&#8217;, &#8216;ContactsTool.loginPage.mainView&#8217;);<br />
}</p>
<p>login.js<br />
&#8212;&#8212;&#8211;<br />
Custom page is created with a button. Clicking the button results in the action &#8217;submitLogin&#8217; on the target ContactsToll (StateChart)<br />
Thus the StatChart will handle this action</p>
<p>Back in core.js<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
//core actions</p>
<p>submitLogin: function() {<br />
  var handled = NO;</p>
<p>  switch(this.state.a){<br />
      // if I came from state A1 (initial login screen)<br />
      case 1:<br />
        // I will go to state A2<br />
        this.goState(&#8216;a&#8217;,2);<br />
        handled = YES;<br />
        break;<br />
  }<br />
  // error! I shouldn&#8217;t end up here. Only valid entry point is from initial login screen!<br />
  if(!handled) console.log(&#8216;ContactsTool#submitLogin Action not handled in state %@[%@]&#8216;.fmt(&#8216;a&#8217;,this.state.a));</p>
<p>&#8211;<br />
and so on from here&#8230; <img src='http://www.itsgotwhatplantscrave.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Any comments?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building Sproutcore Apps with Statecharts (part 2) by Mr</title>
		<link>http://www.itsgotwhatplantscrave.com/2009/02/22/building-sproutcore-apps-with-statecharts-part-2/comment-page-1/#comment-92</link>
		<dc:creator>Mr</dc:creator>
		<pubDate>Fri, 06 Nov 2009 23:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=86#comment-92</guid>
		<description>Mike Subelsky:  what book?  Just google for Harel&#039;s original paper!  (and other pdfs)</description>
		<content:encoded><![CDATA[<p>Mike Subelsky:  what book?  Just google for Harel&#8217;s original paper!  (and other pdfs)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Root Controller Paradigm by Nifty Trick with Root Controller Paradigm &#171; The Codeaholic</title>
		<link>http://www.itsgotwhatplantscrave.com/2009/07/30/root-controller-paradigm/comment-page-1/#comment-79</link>
		<dc:creator>Nifty Trick with Root Controller Paradigm &#171; The Codeaholic</dc:creator>
		<pubDate>Fri, 09 Oct 2009 19:59:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.itsgotwhatplantscrave.com/?p=128#comment-79</guid>
		<description>[...] if you have not read Evin&#8217;s post about the &#8220;Root Controller Paradigm&#8221; click here, I will [...]</description>
		<content:encoded><![CDATA[<p>[...] if you have not read Evin&#8217;s post about the &#8220;Root Controller Paradigm&#8221; click here, I will [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

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