API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.web.forms. JOTGeneratedForm View Source
Author(s)
thibautc
Since
Version
Serial
Hierarchy
 Object
      JOTViewBlock
          JOTViewTag
              JOTForm
                  JOTGeneratedForm
Implements
 JOTGeneratedFormInterface
Subclasses
Description
publicabstract abstract class JOTGeneratedForm
  This is a generic object you can implement/subclass to have a simple HTML form generated from data.
See also:   
Constructors
public JOTGeneratedForm ()
Methods
Hide/Show inherited methods
public void addCategory (JOTFormCategory cat)
  Adds a form category (form section sperator with title)
public void addFormField (JOTFormField field)
  Adds a form field
public void addSubmitButton (JOTFormSubmitButton button)
  The form submit button
public void defineField (String name, int type) [Inherited From JOTForm]
  Define a field of the form (name/field type) You should define all the types you want to use / see in the html form Typically you make calls to this method from within init()
public JOTFormElement get (String name) [Inherited From JOTForm]
  Return an element (by name)
public Hashtable getAll () [Inherited From JOTForm]
Return all the form fields Hastable of {name:JOTFormElement}
public String getContent () [Inherited From JOTViewBlock]
protected String getCss ()
  Ovveride this to change the form CSS It's probably best to have this css into your template and have this return an empty string.
protected String getDescription (JOTFormField field, int spanCpt)
  Ovveride this to change the look of the description (a.k.a form field help CSS popup)
public Hashtable getErrors () [Inherited From JOTForm]
public Hashtable getFlags () [Inherited From JOTViewTag]
public String getFormAction ()
protected String getFormBowells (JOTFlowRequest request) throws Exception
Generates HTMl for the inside of the form, ovveride for cutom html
public String getHtml (JOTFlowRequest request) throws Exception [Specified in JOTGeneratedFormInterface]
  Ovveride this to change the look.
public Vector getItems ()
  Returns all the items (fields,categories,buttons etc..) composing this form.
protected String getJavascript ()
Ovveride this if you want custom javascript
public String getResult () [Inherited From JOTForm]
  Result of the form processing: ie: success, validationFailure etc...
public Hashtable getTagProperties () [Inherited From JOTViewTag]
public boolean hasValidated () [Inherited From JOTForm]
public void init (JOTFlowRequest request) throws Exception [Specified in JOTForm]
public boolean isVisible () [Inherited From JOTViewBlock]
publicabstract void layoutForm (JOTFlowRequest request)
 
public void preValidate () [Inherited From JOTForm]
Override this function if you want to do things before validation runs
public void refreshData (JOTFlowRequest request) throws Exception
public void removeFlag (String flag) [Inherited From JOTViewTag]
  Remove a flag from the HTML (if found)
public void reparseForm (JOTFlowRequest request) [Inherited From JOTForm]
  if new values are found in the request, this is going to be called to parse the new values
publicabstract void save (JOTFlowRequest request) throws Exception [Inherited From JOTForm]
  This will be called after a succesful validation This is where you save your form data ..
public void setContent (String newContent) [Inherited From JOTViewBlock]
  If a content is defined(not null), then the "HTML element" block content will be replaced by the value of newConetnt.
public void setErrors (Hashtable errors) [Inherited From JOTForm]
public void setFlag (String flag) [Inherited From JOTViewTag]
  Used to set a FLAG on an html element.
public void setFormAction (String action)
  Sets where the form should go to "action" Ex: setFormAction("submitform.do");
public void setFormTitle (String title)
  Mai title for the form, that appears at the top of the form
public void setHasValidated (boolean hasValidated) [Inherited From JOTForm]
public void setResult (String result) [Inherited From JOTForm]
public void setTagProperty (String name, String value) [Inherited From JOTViewTag]
  This allows to redefine (or add new) HTML tags to the block.
public void setVisible (boolean visible) [Inherited From JOTViewBlock]
  If set to false, the elemnt will be hidden "removed" from the generated HTML.
public void unsetTagProperty (String name) [Inherited From JOTViewTag]
  Unset a tag property, so that it will be left alone.
protected JOTModel updateModelFromRequest (JOTModel model, Vector items, JOTFlowRequest request) throws Exception [Inherited From JOTForm]
  Update a model's values using the request params.
publicfinal Hashtable validate (JOTFlowRequest request) throws Exception [Specified in JOTForm]
publicabstract Hashtable validateForm (JOTFlowRequest request) throws Exception
  Implement this to validate the form Return a hashtable of errors, or null/empty hashtable if no errors
publicabstract boolean validatePermissions (JOTFlowRequest request) [Inherited From JOTForm]
  Implement this and return true if user is authorized to use this form
Fields
pack-private String action
protected String content [Inherited From JOTViewBlock]
publicfinalstatic String HAD_SUCCESS = "_GeneratedForm_success"
pack-private Vector items
pack-private Hashtable lastResults
publicfinalstatic String REQUEST_ID = "__JOT__SUBMITTED_FORM" [Inherited From JOTForm]
pack-private String title
protected boolean visible [Inherited From JOTViewBlock]
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar