Index

Classes

Class

Methods

Class Banana.Controls.Decorators.Validator


Extends Banana.Controls.Decorators.Decorator.

Methods borrowed from class Banana.Controls.Decorators.Decorator:
getDecoratedControl
Methods borrowed from class Banana.Controls.Panel:
getTagName
Methods borrowed from class Banana.UiControl:
addControl, addCss, addCssClass, getAttribute, getAttributes, getClientId, getCss, getCssClass, getDimensions, getHtmlAttributes, getState, getStyle, getStyleProperty, hasCssClass, registerEvents, removeAttribute, removeCssClass, removeState, setAttribute, setClientId, setCss, setEnabled, setState, setStyle, setVisible, switchCssClass, triggerEvent, unregisterEvents
Methods borrowed from class Banana.Control:
applyToChildren, bind, clear, findControl, generateUniqueId, getControls, getDomEventTypes, getFirstUiControl, getId, getPage, getParent, getProxy, hasBind, invalidateDisplay, onPreInvalidateContents, onWindowResize, remove, render, setId, setPage, setParent, unbind

Defined in: Validator.js.

Class Detail
Banana.Controls.Decorators.Validator(controlToValidate)

Creates base control to validate a control Any Banana.Controls.DataControl can be validated. If you need to change the eventtype where the validator is triggered on, use setValidateOnEventType. By default the validator will be triggered when the validated control fires a dataChanged or focusout event

Parameters:
{Banana.Controls.DataControl} controlToValidate
Method Detail
createComponents()
{mixed} getData()
Returns:
{mixed}
getHtml()
{String} getInfoText()
Returns:
{String}
{Banana.Controls.DataControl} getValidatedControl()
Returns:
{Banana.Controls.DataControl}
{String} getValidationGroup()
Returns:
{String}
hideIndicators()

hides indicator

isValid()
Returns:
bool true when validator is considered as valid
{this} markInvalid(customText)

Manual way to invalidate the control

Parameters:
customText
Returns:
{this}
removeMarkInvalid()

Removes manual mark as invalid flag

{this} setData(data, ignoreEvent, ignoreDom)
Parameters:
{mixed} data
{boolean} ignoreEvent
{boolean} ignoreDom
Returns:
{this}
{this} setInfoText(text)
Parameters:
{String} text
shown when control is invalid
Returns:
{this}
setShowIndicator(value)
Parameters:
{boolean} value
if true when show a little dot in front of the control
{this} setValidateOnEventType(event)

default = dataChanged all dom events are supported, depending on the control type

Parameters:
{String} event
type to validate on
Returns:
{this}
{this} setValidationGroup(group)

Use this method to put validators in a group

Parameters:
{String} group
Returns:
{this}
showIndicators()

shows indicator

unload()

When control is removed, we also remove it from the validation manager. TODO: is this really needed here?

updateDisplay()
validateData(mixed)

abstract override this method to implement your own validate data

Parameters:
mixed

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 05 2012 22:01:50 GMT+0100 (CET)