|
|||||||||
| 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
public abstract class JOTGeneratedForm
This is a generic object you can implement/subclass to have a simple HTML form generated from data. You can subclass it as-is or reimplement/copy methods to modify the generated Html Or implement one of the subclasses such as JOTDBForm You will want to add the needed css classes to your css file. see bellow getCss()
| Field Summary | |
|---|---|
static java.lang.String |
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 | |
|---|---|
JOTGeneratedForm()
|
|
| Method Summary | |
|---|---|
void |
addCategory(JOTFormCategory cat)
Adds a form category (form section sperator with title) |
void |
addFormField(JOTFormField field)
Adds a form field |
void |
addSubmitButton(JOTFormSubmitButton button)
The form submit button |
protected java.lang.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 java.lang.String |
getDescription(JOTFormField field,
int spanCpt)
Ovveride this to change the look of the description (a.k.a form field help CSS popup) |
java.lang.String |
getFormAction()
|
protected java.lang.String |
getFormBowells(JOTFlowRequest request)
Generates HTMl for the inside of the form, ovveride for cutom html |
java.lang.String |
getHtml(JOTFlowRequest request)
Ovveride this to change the look. |
java.util.Vector |
getItems()
Returns all the items (fields,categories,buttons etc..) composing this form. |
protected java.lang.String |
getJavascript()
Ovveride this if you want custom javascript |
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"); |
abstract void |
layoutForm(JOTFlowRequest request)
|
void |
refreshData(JOTFlowRequest request)
|
void |
setFormAction(java.lang.String action)
Sets where the form should go to "action" Ex: setFormAction("submitform.do"); |
void |
setFormTitle(java.lang.String title)
Mai title for the form, that appears at the top of the form |
java.util.Hashtable |
validate(JOTFlowRequest request)
You need to define this method to you want to validate your form. |
abstract java.util.Hashtable |
validateForm(JOTFlowRequest request)
Implement this to validate the form Return a hashtable of errors, or null/empty hashtable if no errors |
| Methods inherited from class net.jot.web.forms.JOTForm |
|---|
defineField, get, getAll, getErrors, getResult, hasValidated, preValidate, reparseForm, save, 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 HAD_SUCCESS
| Constructor Detail |
|---|
public JOTGeneratedForm()
| Method Detail |
|---|
public abstract void layoutForm(JOTFlowRequest request)
request -
public java.lang.String getHtml(JOTFlowRequest request)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String getJavascript()
protected java.lang.String getCss()
protected java.lang.String getDescription(JOTFormField field,
int spanCpt)
field - spanCpt -
protected java.lang.String getFormBowells(JOTFlowRequest request)
throws java.lang.Exception
java.lang.Exceptionpublic void addFormField(JOTFormField field)
field - public void addCategory(JOTFormCategory cat)
cat - public void addSubmitButton(JOTFormSubmitButton button)
button - public void setFormTitle(java.lang.String title)
title -
public void init(JOTFlowRequest request)
throws java.lang.Exception
JOTForm
init in class JOTFormjava.lang.Exception
public void refreshData(JOTFlowRequest request)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getFormAction()
public void setFormAction(java.lang.String action)
action -
public abstract java.util.Hashtable validateForm(JOTFlowRequest request)
throws java.lang.Exception
java.lang.Exception
public final java.util.Hashtable validate(JOTFlowRequest request)
throws java.lang.Exception
JOTForm
validate in class JOTFormjava.lang.Exceptionpublic java.util.Vector getItems()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||