Skip to content

Alpha 1 specification

yanhick edited this page Sep 20, 2011 · 22 revisions

This document is the specification leading Reception to alpha 1.

Goal

This alpha will provide user with the following component in AS and JS :

  • Button
  • Radio button
  • Check box
  • Form
  • Combo box
  • Text Input
  • Text Area
  • Password

Overview

Of the list of component above all of them but the Form component are leaf node, meaning they can't have children. All of those component will inherit from Cocktail's DOMElement. All the input element (all of the above but Form) will inherit from an intermediate class InputDOMElement exposing attributes and event common to all input such as onChange.

The class package will mimic those of Cocktail. This alpha will only have a domElement package.

The Text input and password input, though similar are treated as separate components like in HTML. In flash, display as a password is an attribute of a textfield, we will adopt the HTML way as the implementation will be cleaner, switching from text to password would require replacing the node and it is very unlikely in a form to switch an input from text to password anyway.

Classes description

reception.domElement.abstract.InputDOMElement

The abstract class inherited by all input domElement.

attributes

  • onChange

set/get the callback called when the value of an input changes

  • value

set/get the current value of the input

  • enabled

enable/disable the input

reception.domElement.abstract.FormDOMElement

The abstract class for form container

methods

  • submit

call the onSubmit callback.

attributes

  • onSubmit

set/get the callback called when the form is submitted

  • action

set/get the URL to call once the form is submitted

  • method

set/get the form submission method

reception.domElement.abstract.TextInputDOMElement

attributes

  • text

set/get the input text, as plain text

  • maxChars

set/get the maximum number of character in a text input

reception.domElement.abstract.TextAreaDOMElement

attributes

  • text

set/get the textArea text, as plain text

reception.domElement.abstract.ButtonDOMElement

Doesn't add anything

reception.domElement.abstract.CheckBoxDOMElement

Doesn't add anything, the check/uncheck state is determined by the "value" attribute.

reception.domElement.abstract.RadioDOMElement

Same as checkbox.

reception.domElement.abstract.ComboBoxDOMElement

attributes

  • data

set/get the data containing pairs of label/values

  • selectedIndex

set/get the selected index

  • selectedItem

set/get the selected item

  • selectedLabel

set/get the selected label.

  • onSelect

set/get the method called when an item is selected

reception.domElement.abstract.PasswordDOMElement

Extends textInput domElement and makes the neccessary changes.

reception.domElement.DOMElementData

Contains enum and struct for Reception's DOMElements.

structure

ComboBoxData

Represents an element of the combobox data provider

  • label
  • value

enum

FormMethodValue

Represent the methods to submit a form

  • GET
  • POST