|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.jot.web.view.JOTViewBlock
net.jot.web.view.JOTViewTag
net.jot.web.forms.JOTForm
net.jot.web.forms.JOTGeneratedForm
net.jot.web.forms.JOTDBForm
public abstract class JOTDBForm
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 db object. This is an extension of JOTGeneratedForm, see that for extra documentation. TODO: maybe sublass this for fully automated form this would use a text file description of the form and be fully automatic (stored in db)
| Field Summary | |
|---|---|
static java.lang.String |
JOT_GENERATED_FORM_ID
ID for JOT form |
static java.lang.String |
JOT_GENERATED_FORM_MODEL_CLASS
stores the form/model java class |
static java.lang.String |
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 |
protected JOTModel |
model
You should set this value in your implementatio in upatemodel() |
| Fields inherited from class net.jot.web.forms.JOTGeneratedForm |
|---|
HAD_SUCCESS |
| Fields inherited from class net.jot.web.forms.JOTForm |
|---|
REQUEST_ID |
| Fields inherited from class net.jot.web.view.JOTViewBlock |
|---|
content, visible |
| Constructor Summary | |
|---|---|
JOTDBForm()
|
|
| Method Summary | |
|---|---|
void |
addFormField(JOTFormField field)
Adds a field to the form |
protected java.lang.String |
getFormBowells(JOTFlowRequest request)
Generate the html for the "inside" of the form, using the DB object(model) to set the values etc... |
JOTModel |
getModel()
|
void |
refreshData(JOTFlowRequest request)
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. |
void |
save(JOTFlowRequest request)
Saves the form value into the DB object. |
abstract void |
updateModel(JOTFlowRequest request)
This should be implemented so that it: - retrieves/update the "model" object(ie: does the db query to find/update the DB/Model object). |
| Methods inherited from class net.jot.web.forms.JOTGeneratedForm |
|---|
addCategory, addSubmitButton, getCss, getDescription, getFormAction, getHtml, getItems, getJavascript, init, layoutForm, setFormAction, setFormTitle, validate, validateForm |
| Methods inherited from class net.jot.web.forms.JOTForm |
|---|
defineField, get, getAll, getErrors, getResult, hasValidated, preValidate, reparseForm, setErrors, setHasValidated, setResult, validatePermissions |
| Methods inherited from class net.jot.web.view.JOTViewTag |
|---|
getFlags, getTagProperties, removeFlag, setFlag, setTagProperty, unsetTagProperty |
| Methods inherited from class net.jot.web.view.JOTViewBlock |
|---|
getContent, isVisible, setContent, setVisible |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String JOT_GENERATED_FORM_ID
public static final java.lang.String JOT_GENERATED_FORM_TOKEN
public static final java.lang.String JOT_GENERATED_FORM_MODEL_CLASS
protected JOTModel model
| Constructor Detail |
|---|
public JOTDBForm()
| Method Detail |
|---|
protected java.lang.String getFormBowells(JOTFlowRequest request)
throws java.lang.Exception
getFormBowells in class JOTGeneratedFormrequest -
java.lang.Exceptionpublic void addFormField(JOTFormField field)
addFormField in class JOTGeneratedForm
public void refreshData(JOTFlowRequest request)
throws java.lang.Exception
refreshData in class JOTGeneratedFormjava.lang.Exception
public void save(JOTFlowRequest request)
throws java.lang.Exception
save in class JOTFormrequest -
java.lang.Exception
public abstract void updateModel(JOTFlowRequest request)
throws java.lang.Exception
java.lang.Exceptionpublic JOTModel getModel()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||