View Full Version : passing data from one card to another

8 Jul 2010, 10:34 AM

what's the best way to pass data to another card?

Assume I have a card with 3 dates and one detailCard.
Depending what I have clicked on the first screen I want to show different content.

Now I work like this:

I make a variable in my index.js, lets say "var selectedDay".
When I click a button, I set the variabele "selectedDay" and call "setCard(detailCard)"

DetailCard is an empty card (Panel component) with a listener added --> beforeactivate

When beforeactivate is fired, I call the correspondig handler with a "this.update(selectedDay)" call, to fill the content within the panel.

This works, but not always, sometime my panel is just empty. What am I doing wrong :-)



8 Jul 2010, 2:02 PM
i would prefer to fire your own event in your application scope and include the information you need as params. than on your panel which should show the information, add a listener to you event and onYourEvent update the content of your panel.

8 Jul 2010, 2:08 PM
seems logic :-)

I have done it the quick and dirty way now, time was against me :-)