API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.web.forms. JOTForm View Source
Author(s)
thibautc
Since
Version
Serial
Hierarchy
 Object
      JOTViewBlock
          JOTViewTag
              JOTForm
Implements
Subclasses
Description
publicabstract abstract class JOTForm
  Generic class for handling HTML forms (validate, save the values when validation fail etc...) You probably will want to use one of the subclass rather than this directly: ie: JOTGeneratedForm, JOTDBForm etc...
See also:   
Constructors
public JOTForm ()
Methods
Hide/Show inherited methods
public void defineField (String name, int type)
  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)
  Return an element (by name)
public Hashtable getAll ()
Return all the form fields Hastable of {name:JOTFormElement}
public String getContent () [Inherited From JOTViewBlock]
public Hashtable getErrors ()
public Hashtable getFlags () [Inherited From JOTViewTag]
public String getResult ()
  Result of the form processing: ie: success, validationFailure etc...
public Hashtable getTagProperties () [Inherited From JOTViewTag]
public boolean hasValidated ()
publicabstract void init (JOTFlowRequest request) throws Exception
You can use this method to set initial form values (Called the first time the form is created) Ex: defineField("name", JOTFormConst.TEXTAREA); get("fname").setValue("toto");
public boolean isVisible () [Inherited From JOTViewBlock]
public void preValidate ()
Override this function if you want to do things before validation runs
public void removeFlag (String flag) [Inherited From JOTViewTag]
  Remove a flag from the HTML (if found)
public void reparseForm (JOTFlowRequest request)
  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
  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)
public void setFlag (String flag) [Inherited From JOTViewTag]
  Used to set a FLAG on an html element.
public void setHasValidated (boolean hasValidated)
public void setResult (String result)
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
  Update a model's values using the request params.
publicabstract Hashtable validate (JOTFlowRequest request) throws Exception
  You need to define this method to you want to validate your form.
publicabstract boolean validatePermissions (JOTFlowRequest request)
  Implement this and return true if user is authorized to use this form
Fields
protected String content [Inherited From JOTViewBlock]
publicfinalstatic String REQUEST_ID = "__JOT__SUBMITTED_FORM"
protected boolean visible [Inherited From JOTViewBlock]
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar