On Thu, Mar 17, 2011 at 16:17, Benjamin Dreux <[email protected]>wrote:

> Hi
> How should i do if i want to pass data from transition to the next state.
> In my case, i want to grab some information (in the UI  or from the
> server) during the transition ,because on this position i now where i
> come from and where  i go.
> Then pass the grabbed data to the state.
> The state will take care of presenting the data.
>

The FiniteStateMachine's "addObject" method is used to store an object in
the fsm for access during transitions. That's the intended way to do it. See
the documentation for FiniteStateMachine.addObject. You provide a "friendly
name" for the object. You can later call fsm.getObject(friendlyName) and
fsm.removeObject(friendlyName).

Additionally, FiniteStateMachine, State, and Transition all extend
qx.core.Object which provides the "userData" property. You can call
x.setUserData("name", "value") and x.getUserData("name")  where x is any of
your FiniteStateMachine object, a State object, or a Transition object.
(Just be sure you use the same object on the setUserData and getUserData
calls.)

Derrell
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to