Jaxcent for .NET

Event Handling

There are various events that can be handled in Jaxcent, and some of these come in multiple forms. The OnClick is used to handle clicks. It also has other useful forms The OnClickWithClickData is similar to the basic OnClick event, but when using this version, there is some data delivered along with the event. This data tells whether the Control, ALT and/or Shift keys were pressed when the click occurred. This can allow different processing for button presses.

The OnClickWithPageData event also has some data delivered with the event. In this case, the data is the "page data" - it contains the current value of all input elements on the page. For example, if there are INPUT elements of type TEXT, SELECT, TEXTAREA, RADIO, CHECKBOX etc., the data will include anything the user has typed in the TEXT or TEXTAREA fields, the current choice in the SELECT, and the RADIO and CHECKBOX selection.

Because there are a large number of events available in Jaxcent - most events are initially turned off. Unless you have added an event handler to OnClick or one of its variations, no data will be sent from the client to the server. The first time one of the OnClick events is hooked up to a handler, the Jaxcent framework informs the client, and the click events are sent to the server from the client from that point on. Moreover, if just the basic OnClick is the one that's hooked up, neither click-data or page-data will be sent back. Only if an OnClickWithClickData event handler has been added, will the client start sending click data along with the click event information. Similarly, once an OnClickWithPageData event handler has been added, the client will start sending page data along with the click.

Retrieving page data with the click

The page data can be retrieved at any time using JaxcentPage.GetAllFormData() method.

Typically the page data is only required when the user takes an action, e.g. clicks a "Next" or "Submit" button.

For such cases, it is a more efficient utilization of the network to retrieve the page data along with the click, because all the data comes in a single client-server communication package.

Also see Forms Processing in Jaxcent