Init stages (and the Missing Init Stage) are another favorite topic of
mine. are you fishing? :) As to your saying that they are all the same,
in your code, you have to say .sendEvent and .setAttribute, for
different things. When? why? do i have to look at code to guess? i
prefer simplicity.
Sorry if it's dense to read. These issues are not encountered at the
every day level of work in laszlo. They do figure into larger deployments
Rami Ojares / AMG wrote:
On 21.12.2009 19:30, jamesr wrote:
For anyone reading this, when was the last time a listmember reading
this used <event> so as to work with handlers, anywhere, in any code
base?
I use events when I want to send events, that are not automatically
generated by laszlo (because of attribute definition)
For example:
I have a Tree component that has nodes.
When a node is created or destroyed I send an event
nodeCreated/nodeDestroyed.
This event is in the tree (that contains nodes).
I might call some method directly on the tree but since I had more
than one party interested in this event that's what I did.
Maybe I could have defined some attribute in the tree and let that do
the broadcasting but hell ... It's my code, right :-)
Event is an event.
Attribute is an attribute.
When attribute value changes laszlo sends an event (oh yeah and
remember all caveats).
The most difficult thing in application design is to figure out the
initialization phase.
And I think it is fair to say that laszlo does not make it simple with
all the init stages.
But I'm sure it's all for the best once you get the hang of it (no, I
can't say I really understand it yet).
(This paragraph was here because some of the caveats regarding events
had something to do with initialization order).
- rami