PHsPeed applications follow a standard application flow, that is depending on the application type. A grid application has a different flow than a crud application, but the concepts are the same. In many situations it can be necessary to change the standard behavior of the application, and to apply custom code. In PHsPeed this is done by using events. Events are moments where PHsPeed looks if there is some custom code to integrate. In the below flow chart you can see which standard events apply. 

Standard application flow.


Each component that is created will generate an 'onCreate' event at runtime, that can be used to set some basic properties. Some are done by the developer in the IDE, but if a property has some dependencies, it is possible to change them by code. Do NOT refer to properties of other components, because you cannot be sure that this component is already created. Components are created in a certain sequence, and if you have properties to set, then wait until all components are available. This is the onActivate event. Each component will receive this message. Again, be aware that if you look into a property of a certain component that is triggered later in the sequence that you cannot rely on the value. But there are some standards:


Non visual components like database, queries, tables etc, are generated before the visual components. So if you have to setup all kinds of queries the onCreate/onActivate components are key. But if you have visual components, then you have to be careful. Most of the time, the onBeforeRender is suitable as every component will have it's value, .... unless you change another component in this event that already has been rendered. Looks complex. But once you start working with events, you will see that it is not really of an issue.