Class SweetDevRia.Form
Form
Defined in: Form.js.
Constructor Attributes | Constructor Name and Description |
---|---|
SweetDevRia.Form(id)
|
Field Attributes | Field Name and Description |
---|---|
<static> |
SweetDevRia.Form.CHECKBOX_TYPE
Constant for form checkbox type
|
Name of the class
|
|
<static> |
SweetDevRia.Form.INPUT_TYPE
Constant for form input type
|
<static> |
SweetDevRia.Form.RADIO_TYPE
Constant for form radio type
|
<static> |
SweetDevRia.Form.RIA_CALENDAR_TYPE
Constant for SweetDEV RIA calendar type
|
<static> |
SweetDevRia.Form.RIA_EDITABLE_TYPE
Constant for SweetDEV RIA editable type
|
<static> |
SweetDevRia.Form.RIA_SUGGEST_TYPE
Constant for SweetDEV RIA suggest type
|
<static> |
SweetDevRia.Form.SELECT_TYPE
Constant for form select type
|
<static> |
SweetDevRia.Form.SUBMIT_EVENT
Type of event fire when the form is submitted
|
<static> |
SweetDevRia.Form.TEXTAREA_TYPE
Constant for form text area type
|
Method Attributes | Method Name and Description |
---|---|
This method is called after submit the form component
|
|
<static> |
SweetDevRia.Form.ajaxFormSubmit(form, action, targetZoneId, callback)
Submit a form using Ajax
|
This method is called before submit the form component
To be overridden !!
|
|
<static> |
SweetDevRia.Form.getComponent(identifier, optionnal)
This method is used to get a component through its identifier.
|
<static> |
SweetDevRia.Form.getComponents(identifiers, optionnal)
This method is used to get some components through their identifiers.
|
<static> |
SweetDevRia.Form.getDataProperty(mapping, componentId)
Return the data property name associating of a component id using mapping map
|
<static> |
SweetDevRia.Form.getFormData(form, mapping)
Get data of a form
|
<static> |
SweetDevRia.Form.getLabel(elemId)
Get the label related to an HTML element's id
|
<private> <static> |
SweetDevRia.Form.getType(comp)
Return the component type (ex : input, select, radio, checkbox, calendar, comboMulti)
|
<private> <static> |
SweetDevRia.Form.getValue(name, optionnal)
Return the component value(s) (could be several value in case of select component.
|
<private> <static> |
SweetDevRia.Form.resetComponent(comp)
Reset the component value
|
Set the action for this SweetDevRia Form
|
|
<static> |
SweetDevRia.Form.setFormData(form, data, mapping)
Set data in a form
|
Set the form Id this component acts on
|
|
Set the target zone id handling the submission result for this SweetDevRia Form
|
|
<private> <static> |
SweetDevRia.Form.setValue(comp, value)
Set the value of a component value
|
submit()
Submit the form component.
|
Class Detail
SweetDevRia.Form(id)
- Parameters:
- {String} id
- Identifier of the SweetDevRia.Form component
Field Detail
<static>
{int}
SweetDevRia.Form.CHECKBOX_TYPE
Constant for form checkbox type
{String}
className
Name of the class
<static>
{int}
SweetDevRia.Form.INPUT_TYPE
Constant for form input type
<static>
{int}
SweetDevRia.Form.RADIO_TYPE
Constant for form radio type
<static>
{int}
SweetDevRia.Form.RIA_CALENDAR_TYPE
Constant for SweetDEV RIA calendar type
<static>
{int}
SweetDevRia.Form.RIA_EDITABLE_TYPE
Constant for SweetDEV RIA editable type
<static>
{int}
SweetDevRia.Form.RIA_SUGGEST_TYPE
Constant for SweetDEV RIA suggest type
<static>
{int}
SweetDevRia.Form.SELECT_TYPE
Constant for form select type
<static>
{String}
SweetDevRia.Form.SUBMIT_EVENT
Type of event fire when the form is submitted
<static>
{int}
SweetDevRia.Form.TEXTAREA_TYPE
Constant for form text area type
Method Detail
afterSubmit()
This method is called after submit the form component
- Parameters:
- {String} action.
- Optional new action parameter. To be overridden !!
<static>
SweetDevRia.Form.ajaxFormSubmit(form, action, targetZoneId, callback)
Submit a form using Ajax
- Parameters:
- {HTMLElement} form
- the form element to submit
- {String} action
- an Optional action to redirect the submit target. If none, the form action attribut is used.
- {String} targetZoneId
- Optional id of a zone which will display the form return value. If none, the result will be lost.
- {Function} callback
- Optional function called with the response as parameter
{boolean}
beforeSubmit()
This method is called before submit the form component
To be overridden !!
- Parameters:
- {String} action.
- Optional new action parameter.
- Returns:
- True if this method can be called, else false.
<static>
{HTMLComponent | SweetDevRia.RiaComponent}
SweetDevRia.Form.getComponent(identifier, optionnal)
This method is used to get a component through its identifier. We first look for a SweetDEV RIA component and if none are found, for an html component.
The seeking of the HTML component is first looking for an id corresponding to the identifier, and finally for a name.
- Parameters:
- {String} identifier
- Searched component identifier (ex, "id1,id2").
- {String} optionnal
- formName the form which contains the component
- Returns:
- The component found, or null if none are found for this identifier
<static>
{Array}
SweetDevRia.Form.getComponents(identifiers, optionnal)
This method is used to get some components through their identifiers.
- Parameters:
- {String} identifiers
- Searched component identifiers (ex, "id1,id2"), comma separated.
- {String} optionnal
- formName the form which contains the component
- Returns:
- An array of components associated with these identifiers
<static>
{String}
SweetDevRia.Form.getDataProperty(mapping, componentId)
Return the data property name associating of a component id using mapping map
- Parameters:
- {Map} mapping
- Mapping between html element id and data property (ex : {"name":"firstName", "age":"year"} )
- {String} componentId
- component id
- Returns:
- the data property according to this HTML id, or the componentId itself if none are found in the mapping
<static>
{Map}
SweetDevRia.Form.getFormData(form, mapping)
Get data of a form
- Parameters:
- {Form} form
- Formular to get data
- {Map} mapping
- Mapping between html element id and data property (ex : {"name":"firstName", "age":"year"} )
- Returns:
- Data of this formular
<static>
{String}
SweetDevRia.Form.getLabel(elemId)
Get the label related to an HTML element's id
- Parameters:
- {String} elemId
- the HTML element id to get the label related
- Returns:
- the label fo this HTML id
<private> <static>
{int}
SweetDevRia.Form.getType(comp)
Return the component type (ex : input, select, radio, checkbox, calendar, comboMulti)
- Parameters:
- {Object} comp
- Component to return type
- Returns:
- component type (ex : SweetDevRia.Form.INPUT_TYPE)
<private> <static>
{String/Array of String (if several values)}
SweetDevRia.Form.getValue(name, optionnal)
Return the component value(s) (could be several value in case of select component.
- Parameters:
- {String} name
- component name which we want the value
- {String} optionnal
- formName the form which contains the component
- Returns:
- The source component value
<private> <static>
SweetDevRia.Form.resetComponent(comp)
Reset the component value
- Parameters:
- {Component} comp
- component to reset
setAction()
Set the action for this SweetDevRia Form
- Parameters:
- {String} action.
- New action parameter.
<static>
SweetDevRia.Form.setFormData(form, data, mapping)
Set data in a form
- Parameters:
- {Form} form
- Formular to set data
- {Map} data
- Data to set
- {Map} mapping
- Mapping between html element id and data property (ex : {"name":"firstName", "age":"year"} )
setFormId()
Set the form Id this component acts on
- Parameters:
- {String} formId.
- New form id for this object.
setTargetZoneId()
Set the target zone id handling the submission result for this SweetDevRia Form
- Parameters:
- {String} targetZoneId.
- New targetZoneId for this object.
<private> <static>
SweetDevRia.Form.setValue(comp, value)
Set the value of a component value
- Parameters:
- {component} comp
- Component to set
- {String} value
- the new value to set
submit()
Submit the form component.
- Parameters:
- {String} action.
- Optional new action parameter.