This is a generic object you can implement/subclass to have a simple HTML form generated from data.
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()
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()
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()
Parameters: - name -
- type -
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.
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. This here are just default that would work independently of the template.
This will be called after a succesful validation
This is where you save your form data ..
This will be called after a succesful validation This is where you save your form data .. wherever you want to save it like a database etc ... Implementation note: if the field is saveAutomatically=false, then we won't save that field
Returns:
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.
If a content is defined(not null), then the "HTML element" block content will be replaced by the value of newConetnt. ie:
xyzxyz
If newParam is set to "aaaaa", the rendered HTML page will show: aaaaaa If newParam is set to null, the rendered HTML page will show: xyzxyz
Parameters: - newContent - default:null
public void
setErrors
(Hashtable errors)
[Inherited From JOTForm]
This allows to redefine (or add new) HTML tags to the block.
This allows to redefine (or add new) HTML tags to the block. For example say you have this block: You have added the following htmlTags using setHtmlTags: ["class","css1"] ["border","2"] The htmnl output will look like this:
public void
setVisible
(boolean visible)
[Inherited From JOTViewBlock]
If set to false, the elemnt will be hidden "removed" from the generated HTML.
If set to false, the elemnt will be hidden "removed" from the generated HTML.
Parameters: - visible - default:true
public void
unsetTagProperty
(String name)
[Inherited From JOTViewTag]
Unset a tag property, so that it will be left alone.
Unset a tag property, so that it will be left alone.
Parameters: - name -
- value -