Getting Started
Setting Up
Creating Objects
Invoking Methods
Using Events
Raising
Handling I
Handling II

Tag Reference

Object Reference

Download

Mailing List

Other Links

Warning: Before learning about the Event System in cfObjects, I strongly suggest that you get a solid understanding of effectively creating classes and encapsulating code into methods

If you have any previous experience with OOP languages such as Java, C++ or the .NET CLR, you might already understand the concept of event handling. In fact, you might be asking yourself, "How is it possible to have event handling in a static environment like a web page?"

For those of you new to OOP concepts, here's a short descrption of a typical event for an operating system:


Every time the user types a character or pushes a mouse button, an event occurs. Any object can be notified of the event. All it has to do is implement the appropriate interface and be registered as an event listener on the appropriate event source.

In web application development, however, events are subtly different. They are defined by the developer as a kind of placeholder in the code that can act different ways depending on what page the user is viewing.

An example on this site would be the graphic at the top that tells you what step you are on. For this page, it says "Step 11 of 24 - Responding to Events". That graphic is displayed in the same place on every page and is hard coded into the HTML on a standard, static site.

On a dynamic, cfObjects site, you could raise an event at that spot in the code of your page template and then have each individual page define what it wants to do with that event.

Let's look at it more detail in Step 12 -->











SourceForge.net Logo