Jala 1.3

Class jala.Form

Object
   |
   +--jala.Form

class jala.Form


A class that renders forms, validates submitted form data and stores the data in a specified object.
Defined in Form.js


Nested Class Summary
<static class> jala.Form.Component
<static class> jala.Form.Tracker
 
Field Summary
 Skin componentSkin
          Contains the default component skin
 String name
          Readonly reference to the name of the form
<static>  <final> String CHECKOPTIONS
          Constant used by require function to define that a select or radio component should validate only if the user input is contained in the list of options provided.
<static>  <final> String CONTENTTYPE
          Constant used by require function to define that a file upload component should validate only if the file's content type is in the list of allowed content types provided.
<static>  helma.Html html
          The HTML renderer used by jala.Form
<static>  <final> String MAXHEIGHT
          Constant used by require function to define that an image upload component should validate only if the image's height is less than the value provided.
<static>  <final> String MAXLENGTH
          Constant used by require function to define that a component should not validate if userinput exceeds a maximum length.
<static>  <final> String MAXWIDTH
          Constant used by require function to define that an image upload component should validate only if the image's width is less than the value provided.
<static>  <final> String MINHEIGHT
          Constant used by require function to define that an image upload component should validate only if the image's height is more than the value provided.
<static>  <final> String MINLENGTH
          Constant used by require function to define that a component should not validate if userinput is shorter than a given length.
<static>  <final> String MINWIDTH
          Constant used by require function to define that an image upload component should validate only if the image's width is more than the value provided.
<static>  <final> String REQUIRE
          Constant used by require function to define that a component should validate only if the user did provide input.
 
Constructor Summary
jala.Form (<String> name, <Object> dataObj)
            Constructs a new Form instance
 
Method Summary
 void addComponent(<jala.Form.Component.Input> component)
           Adds a component to this jala.Form instance
 String class_macro()
           Returns the class name of the form
 void close_macro()
           Writes the form closing tag to response
 Boolean containsFileUpload()
           Returns true if this instance of jala.Form contains at least one component doing a file upload.
 Number countErrors()
           If this instance of jala.Form holds a jala.Form.Tracker instance it returns the number of components that didn't validate.
 String createDomId()
           Creates a DOM identifier based on the arguments passed.
 String getClassName()
           Returns the class name set for this form instance.
 Object getDataObject()
           Returns the data object containing the values used for rendering the form.
 String getErrorMessage()
           Returns the general error message printed above the form if any of the components didn't validate.
 jala.Form.Tracker getTracker()
           Returns the tracker object this form instance uses for collecting error messages and parsed values.
 Boolean handle(<Object> reqData, <Object> destObj)
           Parses form input, applies check functions and stores the values if the form does validate.
 Boolean hasError()
           Returns true if this instance of jala.Form holds a jala.Form.Tracker instance and at least one error has been set on this tracker.
 String id_macro()
           Returns the id (equal to the name) of the form
 Array listComponents()
           Returns an array containing the components of this jala.Form instance.
 String name_macro()
           Returns the name (equal to the id) of the form
 void open_macro()
           Writes the form opening tag to response
 void render()
           Renders this form including all components to response.
 void render_macro()
           Renders the whole form to response
 String renderAsString(param)
           renders the form as a string
 void save(<jala.Form.Tracker> tracker, <Object> destObj)
           Sets the parsed values on an object.
 void setClassName(<String> newClassName)
           Sets an extra classname for this form instance
 void setDataObject(newDataObj)
           Sets the data object which is being edited by this form.
 void setErrorMessage(<String> newErrorMessage)
           Sets the general error message printed above the form if any of the components didn't validate.
 void setTracker(<jala.Form.Tracker> newTracker)
           Sets the tracker object this form instance uses for collecting error messages and parsed values.
 jala.Form.Tracker validate(<Object> reqData)
           Validates user input from a submitted form by calling each component's validate method.
<static> jala.Form create(<Object> config, dataObj)
           Parses a plain javascript object tree and configures a new jala.Form instance according to the properties.
<static> void extend(<Function> subClass, <Function> superClass)
           Utility to set up the prototype, constructor, superclass and superconstructor properties to support an inheritance strategy that can chain constructors and methods.
<static> String isEmail(<String> name, <String> value, <Object> reqData, <jala.Form> formObj)
           Static validator function to test values for being a valid email address.
<static> String isUrl(<String> name, <String> value, <Object> reqData, <jala.Form> formObj)
           Static validator function to test values for being a valid url.
<static> Object propertyGetter(<String> name, value)
           static default getter function used to return a field from the data object.
<static> void propertySetter(<String> name, <Object> value)
           static default setter function used to change a field of the data object.

Field Detail

componentSkin

Skin componentSkin

name

String name

CHECKOPTIONS

<static> <final> String CHECKOPTIONS

CONTENTTYPE

<static> <final> String CONTENTTYPE

html

<static> helma.Html html

MAXHEIGHT

<static> <final> String MAXHEIGHT

MAXLENGTH

<static> <final> String MAXLENGTH

MAXWIDTH

<static> <final> String MAXWIDTH

MINHEIGHT

<static> <final> String MINHEIGHT

MINLENGTH

<static> <final> String MINLENGTH

MINWIDTH

<static> <final> String MINWIDTH

REQUIRE

<static> <final> String REQUIRE

Constructor Detail

jala.Form

jala.Form(<String> name, <Object> dataObj)

Method Detail

addComponent

void addComponent(<jala.Form.Component.Input> component)

class_macro

String class_macro()

close_macro

void close_macro()

containsFileUpload

Boolean containsFileUpload()

countErrors

Number countErrors()

createDomId

String createDomId()

getClassName

String getClassName()

getDataObject

Object getDataObject()

getErrorMessage

String getErrorMessage()

getTracker

jala.Form.Tracker getTracker()

handle

Boolean handle(<Object> reqData, <Object> destObj)

hasError

Boolean hasError()

id_macro

String id_macro()

listComponents

Array listComponents()

name_macro

String name_macro()

open_macro

void open_macro()

render

void render()

render_macro

void render_macro()

renderAsString

String renderAsString(param)

save

void save(<jala.Form.Tracker> tracker, <Object> destObj)

setClassName

void setClassName(<String> newClassName)

setDataObject

void setDataObject(newDataObj)

setErrorMessage

void setErrorMessage(<String> newErrorMessage)

setTracker

void setTracker(<jala.Form.Tracker> newTracker)

validate

jala.Form.Tracker validate(<Object> reqData)

create

<static> jala.Form create(<Object> config, dataObj)

extend

<static> void extend(<Function> subClass, <Function> superClass)

isEmail

<static> String isEmail(<String> name, <String> value, <Object> reqData, <jala.Form> formObj)

isUrl

<static> String isUrl(<String> name, <String> value, <Object> reqData, <jala.Form> formObj)

propertyGetter

<static> Object propertyGetter(<String> name, value)

propertySetter

<static> void propertySetter(<String> name, <Object> value)

Jala 1.3

Documentation generated by JSDoc on Tue Jan 8 15:45:31 2008