Class jabberwerx.ui.XDataFormView
Extends
jabberwerx.ui.JWView.
View for displaying XDataForm.
This displays the XDataForm including title, instructions and all visible fields.
This class provides the following events:Constructor Attributes | Constructor Name and Description |
---|---|
jabberwerx.ui.XDataFormView(dataForm)
Creates a XDataFormView object. |
- Fields borrowed from class jabberwerx.ui.JWView:
- jq
Method Attributes | Method Name and Description |
---|---|
cancel()
Creates XDataForm of type "cancel". |
|
createDOM(doc)
Creates the DOM for XDataForm to display including title, instructions and DOM's of each field. |
|
getFieldValues(field)
Returns array of field values for the passed field. |
|
submit()
Creates XDataForm of type "submit". |
|
update()
Updates this view. |
- Methods borrowed from class jabberwerx.ui.JWView:
- destroy, destroyDOM, dimensions, height, hide, parent, persistOptions, remove, render, restoreDOM, restoreRender, restoreUpdate, shouldBeSavedWithGraph, show, wasUnserialized, width, willBeSerialized
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event
- Methods borrowed from class jabberwerx.JWBase:
- getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString
Creates a XDataFormView object.
- Parameters:
- {jabberwerx.XDataForm} dataForm
- Data form to initialize the view with.
- Throws:
- {TypeError}
- If dataForm is not valid
Creates XDataForm of type "cancel".
- Returns:
- {XDataForm} Data form type cancel.
Creates the DOM for XDataForm to display including title, instructions and DOM's of each field. DOM:
<div class="jabberwerx xdata_form_view"> <table> <tr id="title_row"> <td class="title" colspan="2">Title text</td> </tr> <tr id="instr"> <td class="title" colspan="2">Instructions</td> </tr> </table> </div> </div>
- Parameters:
- {Element} doc
- Element for embedding the view
- Returns:
- {Element} The generated element to display
Returns array of field values for the passed field.
- Parameters:
- {jabberwerx.XDataFormField} field
- Field for which to return the values
- Returns:
- {Array} Values for the field, can be empty.
Creates XDataForm of type "submit".
- Returns:
- {XDataForm} Data form type submit.
Updates this view. This method is called by jabberwerx.ui.JWView#dimensions, jabberwerx.ui.JWView#height, and jabberwerx.ui.JWView#width automatically, but may also be called directly to force an update of the view.
This method will size all child html controls on the form to fit within the width of client area. This is done here since width and height of the view should be esteblished before we can calculate the width of the client area, since we need to take scroll bars into account.
- Returns:
- {Boolean} true if the view is updatable (e.g. if jabberwerx.ui.JWView#jq is valid).