On Switch Panel: Parameters possible?

Hi there,

I am using a "Panels" Kind with a CarouselArranger, much like the Enyo2-Sampler-App does. When the user clicks an button on Panel 1, a do a "this.next()" on it's Parent (the "Panels" Kind). I want to make the apperance of the second panel dependent on the clicked button on the first panel.
The Sampler-App does something similar: When I tap on "Enyo Core", the second panel has other list-entries as to when I tap on "Onyx". Is this kind of Paramter-Passing possible or do I have to create an own kind for every possible Panel that can appear?

P.S.: Something like "this.next({mode: "special_1"})" ?

Comments

  • Not really, in the way you describe. You COULD listen for onTransitionFinish on the Panels kind and re-construct the view after it's in sight (or do it in onTransitionStart), but these are imperfect solutions.

    What I would probably do is make it so my second (and third and so on) panels didn't exist until the user has tapped the entry in the first one, then dynamically construct the panel component, reflow the Panels, and finally do next().

    I'm sure someone will jump in to describe exactly why I'm nuts ;)
  • I'd suggest using custom events. So, you'd fire a custom event, handle that event in the parent, and navigate to the requested panel. Whether or not you have unique kinds for each panel is up to you.
  • OK, I did it the way theryanjduffy suggested. If someone clicks on a list-item on the first panel, I'm bubbling a custom event up to it's parent, then waterfalling another custom event down to it's children and capturing it in the second panel. Then I just do an reset on my list.

    Work's like a charm. At least currently, I don't know yet if this "sending messages everywhere" has some performance impact.
Sign In or Register to comment.