|
|||||||||
| 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
public 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... Or you can Subclass this directly for more control Form objects provide easy parsing/validation of web forms
| Field Summary | |
|---|---|
static java.lang.String |
REQUEST_ID
|
| Fields inherited from class net.jot.web.view.JOTViewBlock |
|---|
content, visible |
| Constructor Summary | |
|---|---|
JOTForm()
|
|
| Method Summary | |
|---|---|
void |
defineField(java.lang.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() |
JOTFormElement |
get(java.lang.String name)
Return an element (by name) |
java.util.Hashtable |
getAll()
Return all the form fields Hastable of {name:JOTFormElement} |
java.util.Hashtable |
getErrors()
|
java.lang.String |
getResult()
Result of the form processing: ie: success, validationFailure etc... |
boolean |
hasValidated()
|
abstract void |
init(JOTFlowRequest request)
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"); |
void |
preValidate()
Override this function if you want to do things before validation runs |
void |
reparseForm(JOTFlowRequest request)
if new values are found in the request, this is going to be called to parse the new values |
abstract void |
save(JOTFlowRequest request)
This will be called after a succesful validation This is where you save your form data .. |
void |
setErrors(java.util.Hashtable errors)
|
void |
setHasValidated(boolean hasValidated)
|
void |
setResult(java.lang.String result)
|
abstract java.util.Hashtable |
validate(JOTFlowRequest request)
You need to define this method to you want to validate your form. |
abstract boolean |
validatePermissions(JOTFlowRequest request)
Implement this and return true if user is authorized to use this form |
| 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 REQUEST_ID
| Constructor Detail |
|---|
public JOTForm()
| Method Detail |
|---|
public abstract boolean validatePermissions(JOTFlowRequest request)
request -
public abstract void init(JOTFlowRequest request)
throws java.lang.Exception
java.lang.Exception
public abstract java.util.Hashtable validate(JOTFlowRequest request)
throws java.lang.Exception
java.lang.Exception
public abstract void save(JOTFlowRequest request)
throws java.lang.Exception
java.lang.Exceptionpublic void preValidate()
public void defineField(java.lang.String name,
int type)
name - type - public java.util.Hashtable getAll()
public JOTFormElement get(java.lang.String name)
name -
public void reparseForm(JOTFlowRequest request)
request - public java.util.Hashtable getErrors()
public void setErrors(java.util.Hashtable errors)
public boolean hasValidated()
public void setHasValidated(boolean hasValidated)
public java.lang.String getResult()
public void setResult(java.lang.String result)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||