OnClickis used to handle clicks. It also has other useful forms
OnClickWithClickDatais similar to the basic
OnClickevent, 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.
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
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.
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