events.coffee | |
---|---|
Copyright 2012-2014 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | |
t5/core/eventsThis module defines logical names for all events that Tapestry-controlled elements trigger or listener for. Prototype requires that all custom events have a namespace prefix; jQuery appears to allow it without issue. | define |
Defines events related to the validation and submission of forms. See module | form: |
Triggered after fields have been validated, when there are no field validation exceptions, to allow for
cross-form validation. Passed a memo object: the handler should set the | validate: "t5:form:validate" |
Triggered after | prepareForSubmit: "t5:form:prepare-for-submit" |
Events releated to form input fields. Primarily, these events are related to form input validation. Validating a field involves three major steps:
A field that is blank but not required is considered valid: the translate and validate steps are skipped. When a validation error occurs, the event handler should present the validation error (see below), but also
return Presenting validation error: The event handler has two options for indicating a validation failure at any of the three steps:
| field: |
Perform the optionality check. The event memo includes a | optional: "t5:field:optional" |
Trigged by the field if there is a field value (a non-empty string, or a non-empty array in the case
of a select element). The event memo includes the field's value as the An event handler may update the event, setting the | translate: "t5:field:translate" |
Triggered by the field if there is a field value, and the | validate: "t5:field:validate" |
Triggered by the form on all enclosed elements with the This event is passed a memo object; it should set the memo's | inputValidation: "t5:field:input-validation" |
Clears and hides the element used to display validation error messages. There is no memo for this event. The p.help-block for the field is located (if it exists) and emptied and hidden. The containing .form-group element (if it exists) has its "has-error" class name removed. | clearValidationError: "t5:field:clear-validation-error" |
Presents a validation error for a field. The event memo should have a The rules for locating the help block:
The rules for creating the help block:
| showValidationError: "t5:field:show-validation-error" |
Events triggered by the Palette component. | palette: |
Event triggered when the selection is about to change.
| willChange: "t5:palette:willChange" |
Event triggered after the Palette selection has changed.
| didChange: "t5:palette:didChange" |
Defines a number of event names specific to Tapestry Zones. Zones are Tapestry components that are structured
to correctly support dynamic updates from the server via an Ajax request, and a standard response
(the partial page render reponse). More details are available in the | zone: |
Invoked on a zone element to force an update to its content. The event memo should contain a | update: "t5:zone:update" |
Triggered (by the standard | willUpdate: "t5:zone:will-update" |
Triggered (by the standard Certain components bind this event to scan new additions to the page to see if certain structures exist and
create client-side support in the form of controllers and event handlers. DateField is one such example
(see | didUpdate: "t5:zone:did-update" |
Triggered on (or within) a zone element, the default handler will peform an Ajax request and, when the response is available,
update the zone (via
| refresh: "t5:zone:refresh" |
Event names for arbitrary elements. These notifications exist primarily to allow for customizations in how certain behaviors are presented, for example, to add animation when certain elements are hidden or revealed. | element: |
Triggered when a hidden element has just been displayed. | didShow: "t5:element:did-show" |
Trigered when a visible element has just been hidden. | didHide: "t5:element:did-hide" |
Event names specific to client-side element associated with the FormFragment component. These events exist to allow client code to cleanly adjust the visibility of the fragment, or remove it. | formfragment: |
Requests that the fragment change its visibility. The event memo is an object with a single key, visible, a
boolean. The fragment will show or hide itself if necessary (triggering the | changeVisibility: "t5:fragment:change-visibility"
|