Custom Form Elements for mootools

core 

:: Custom Form Elements for mootools > core > cfe.generic 0.9.4
Filters

Class cfe.generic

Known Subclasses:
cfe.modules.fieldset cfe.modules.file cfe.module.select cfe.module.submit cfe.module.text cfe.modules.checkbox cfe.module.image
cfe.generic gets extended by modules to start off with standard, button-like behaviours.

Constructor

cfe.generic ( )

Properties

options - object

basic options for all cfes and always available

type - string

Describes the type of this element (e.g. Selector, Checkbox or Radiobutton)

Methods

build

protected void build ( )
part of the main template method for building the "decorator"
must be extended by subclasses
Returns: void

buildWrapper

protected void buildWrapper ( )
builds the "decorator"
Returns: void

clicked

protected void clicked ( )
wrapper method for event onClick
delegates the click to the "original" element
may be extended by subclasses
Returns: void

createOriginal

HTMLElement createOriginal ( )
programatically creates an "original" element
each subclass has to implement this
Returns: HTMLElement

disable

protected void disable ( )
wrapper method for event onDisable
may be extended by subclasses
Returns: void

enable

protected void enable ( )
wrapper method for event onEnable
may be extended by subclasses
Returns: void

getLabel

HTMLElement getLabel ( )
retreive the label
Returns: HTMLElement

hideOriginal

protected void hideOriginal ( )
hides the original input element by pushing it out of the viewport
(no display:none since it's important for screenreaders to parse the original element)
Returns: void

initialize

void initialize ( options )
constructor
building algorithm for cfe (template method)
  1. setOptions: set Options
  2. buildWrapper: setup the "decorator"
  3. setupOriginal: procede the "original" element (add Events...)
  4. addLabel: add and procede the label
  5. initializeAdv: last chance for subclasses to do initialization
  6. build: various specific dom handling and "decorator" building
Parameters:
options <Object>
Returns: void

initializeAdv

protected void initializeAdv ( )
part of the main template method for building the "decorator"
gets called immediately before the build-method
may be extended by subclasses
Returns: void

isDisabled

isDisabled ( )
getter for retrieving the disabled state of the "original" element

onMouseOver

protected void onMouseOver ( )
wrapper method for event onMouseOver
may be extended by subclasses
Returns: void

press

protected void press ( )
wrapper method for event onPress
may be extended by subclasses
Returns: void

release

protected void release ( )
wrapper method for event onRelease
may be extended by subclasses
Returns: void

removeFocus

protected void removeFocus ( )
wrapper method for event onBlur
may be extended by subclasses
Returns: void

setFocus

protected void setFocus ( )
wrapper method for event onFocus
may be extended by subclasses
Returns: void

setupOriginal

protected void setupOriginal ( )
handles the creation of the underlying original form element
stores a reference to the cfe object in the original form element
Returns: void

setupWrapper

protected void setupWrapper ( )
adds events and mousepointer style to the "decorator" usually gets called by buildWrapper
Returns: void

toElement

HTMLElement toElement ( )
retreive the "decorator" mootools supports the use of $(myCfe) if toElement is defined
Returns: HTMLElement

toElements

HTMLElement[label, alias] toElements ( )
retreive the label and the alias
Returns: HTMLElement[label, alias]

unhover

protected void unhover ( )
wrapper method for event onMouseOut
may be extended by subclasses
Returns: void

update

protected void update ( )
wrapper method for event onUpdate
may be extended by subclasses
Returns: void

Events (Option Attributes)

onBlur

onBlur ( )
Fired when the "original" element loses focus

onClick

onClick ( )
Fired when "decorator" is clicked by mouse

onDisable

onDisable ( )
Fired when "original" gets disabled by HTMLElement.disable()

onEnable

onEnable ( )
Fired when "original" gets disabled by HTMLElement.enable()

onFocus

onFocus ( )
Fired when the "original" element gets focus (e.g. by tabbing)

onMouseOut

onMouseOut ( )
Fired when the mouse is moved away from the "decorator" element

onMouseOver

onMouseOver ( )
Fired when the mouse is moved over the "decorator" element

onPress

onPress ( )
Fired when pressing down with the mouse button on the "decorator" Fired when pressing the space key while "original" has focus

onRelease

onRelease ( )
Fired when "decorator" was pressed and the mouse button is released Fired when "original" was pressed by space key and this key is released

onUpdate

onUpdate ( )
Fired when "original"'s value changes

Configuration (Option Attributes)

aliasType - string

the element's wrapper will be of this type (e.g. span or div)

disabled - boolean

setting this to true will create a disabled element

label - HTMLElement

may pass any element as a label (toggling, hovering,..) for this cfe

name - string

if this cfe is created programatically, it's possible to set the name attribute of the generated input element

replaces - HTMLElement

if this element shall replace an existing html form element, pass it here

spacer - string

path to transparent spacer.gif; it's used for easy css-styling

back to top | © 2007-2009 | custom form elements mediavrog project. | documentation build with YUI Doc from Yahoo!