API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.web.forms. JOTDBItemForm View Source
Author(s)
thibautc
Since
Version
Serial
Hierarchy
 Object
      JOTViewBlock
          JOTViewTag
              JOTForm
                  JOTGeneratedForm
                      JOTDBItemForm
Implements
Subclasses
Description
publicabstract abstract class JOTDBItemForm
This form helps into automatically generating/parsing an HTMl form to/From a Database entry(DB Model) It allows for simple CRUD actions on a particular db object (just one) This is an extension of JOTGeneratedForm, see that for extra documentation.
See also:   
Constructors
public JOTDBItemForm ()
Methods
Hide/Show inherited methods
public void addCategory (JOTFormCategory cat) [Inherited From JOTGeneratedForm]
  Adds a form category (form section sperator with title)
public void addFormField (JOTFormField field) [Overrides JOTGeneratedForm]
Adds a field to the form
public void addSubmitButton (JOTFormSubmitButton button) [Inherited From JOTGeneratedForm]
  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 () [Inherited From JOTGeneratedForm]
  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) [Inherited From JOTGeneratedForm]
  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 () [Inherited From JOTGeneratedForm]
protected String getFormBowells (JOTFlowRequest request) throws Exception [Overrides JOTGeneratedForm]
  Generate the html for the "inside" of the form, using the DB object(model) to set the values etc...
public String getHtml (JOTFlowRequest request) throws Exception [Inherited From JOTGeneratedForm]
  Ovveride this to change the look.
public Vector getItems () [Inherited From JOTGeneratedForm]
  Returns all the items (fields,categories,buttons etc..) composing this form.
protected String getJavascript () [Inherited From JOTGeneratedForm]
Ovveride this if you want custom javascript
public JOTModel getModel ()
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 [Inherited From JOTGeneratedForm] [Specified in JOTForm]
public boolean isVisible () [Inherited From JOTViewBlock]
publicabstract void layoutForm (JOTFlowRequest request) [Inherited From JOTGeneratedForm]
 
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 [Overrides JOTGeneratedForm]
Needs to be called whenever you want the form data to be re-fetched from the data source/db Need to be called at least once after the form is created.
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
public void save (JOTFlowRequest request) throws Exception [Specified in JOTForm]
  Saves the form value into the DB object.
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) [Inherited From JOTGeneratedForm]
  Sets where the form should go to "action" Ex: setFormAction("submitform.do");
public void setFormTitle (String title) [Inherited From JOTGeneratedForm]
  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.
publicabstract void updateModel (JOTFlowRequest request) throws Exception
  This should be implemented so that it: - retrieves/update the "model" object(ie: does the db query to find/update the DB/Model object).
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 [Inherited From JOTGeneratedForm] [Specified in JOTForm]
publicabstract Hashtable validateForm (JOTFlowRequest request) throws Exception [Inherited From JOTGeneratedForm]
  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 [Inherited From JOTGeneratedForm]
protected String content [Inherited From JOTViewBlock]
publicfinalstatic String HAD_SUCCESS = "_GeneratedForm_success" [Inherited From JOTGeneratedForm]
pack-private Vector items [Inherited From JOTGeneratedForm]
publicfinalstatic String JOT_GENERATED_FORM_ID = "JOT_GENERATED_FORM_ID"
ID for JOT form
publicfinalstatic String JOT_GENERATED_FORM_MODEL_CLASS = "JOT_GENERATED_FORM_MODEL_CLASS"
stores the form/model java class
publicfinalstatic String JOT_GENERATED_FORM_TOKEN = "JOT_GENERATED_FORM_TOKEN"
The token is here for security reasons, so that somebody can't fake the form request and change a different DB entry than the one he is suppose to be editing
pack-private Hashtable lastResults [Inherited From JOTGeneratedForm]
protected JOTModel model
You should set this value in your implementatio in upatemodel()
publicfinalstatic String REQUEST_ID = "__JOT__SUBMITTED_FORM" [Inherited From JOTForm]
pack-private String title [Inherited From JOTGeneratedForm]
protected boolean visible [Inherited From JOTViewBlock]
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar