Understand kinds and global/local controls

edited September 2012 in Newbie Questions
Hello,
I'm building a practice app that is based on the twitter tutorials and I'm stuck. I have 3 kind's: The first two (ref: a & b) are based on tweet.js and TwitterSearchApp.js, both are controls, and both can see each other. The third (ref: c) is also a control and is based on the enyo.sample.ListPulldownSample from the Sampler.

OK, the issue is this: I make a new instance of c which presents a list of values. Based on an ontap, I am trying to call b via a "var somename = new b(); from within c but get: "Uncaught TypeError: undefined is not a function"

Individually I can do a "var somename = new b();" and "var someothername = new c();" in my html so I know each kind works but I can't figure out how to expose b to c. Should I just make one large kind or attempt to combine b and c?

Hope that makes sense. And thanks in advance.

Comments

  • In enyo I think you need to use createComponent. See the API for reference under enyo component.

    I think the other you need to look at is what b will be a component of: is it of a or of c (hierarchy). It is not clear from what you wrote.

    Will
  • Thanks Strider. I will look into it. b will be a component used by c.
  • Strider, that was it. I needed to create the component within the kind I was calling the component from. I get it now. Thanks!
Sign In or Register to comment.