uk.co.weft.htform
Class IntegerWidget
java.lang.Object
uk.co.weft.htform.ResourceConsumerImpl
uk.co.weft.domutil.NodeGeneratorImpl
uk.co.weft.htform.Widget
uk.co.weft.htform.IntegerWidget
- All Implemented Interfaces:
- java.lang.Cloneable, NodeGenerator, ResourceConsumer
- Direct Known Subclasses:
- RangeWidget
- public class IntegerWidget
- extends Widget
A widget which constrains entry to integers -- if JavaScript allows. All
the intelligence for this is in the JavaScript, q.v.
- Version:
- $Revision: 1.8.4.1 $ This revision: $Author: simon $
- Author:
- Simon Brooke
|
Field Summary |
protected int |
iw_size
my size |
| Fields inherited from class uk.co.weft.htform.Widget |
ACTIONCSSCLASS, akprompt, attrs, CONTEXTATTRIBUTESSUFFIX, cssClass, DANGEROUSCSSCLASS, debug, DEFAULTTOKEN, dflt, form, generateAs, GENERATEASHTML, GENERATEASXFORM, GENERATEASXML, help, HELPTOKEN, immutable, ISIMMUTABLETOKEN, ISMANDATORYTOKEN, mandatory, MANDATORYCSSCLASS, maxVisibleSize, name, NAMETOKEN, OPTIONALCSSCLASS, PREVIOUSVALUESUFFIX, prompt, PROMPTTOKEN, size, SIZETOKEN, type, TYPETOKEN |
|
Constructor Summary |
IntegerWidget()
If you use this constructor, you are strongly advised to use the init()
method. |
IntegerWidget(java.lang.String myname)
minimum initialisation is I must have a name |
IntegerWidget(java.lang.String myname,
java.lang.String myprompt)
name and prompt is better |
IntegerWidget(java.lang.String myname,
java.lang.String myprompt,
java.lang.String myhelp)
name, prompt and helptext is better still. |
|
Method Summary |
protected void |
preProcess(Context context)
Check that the value, if present, is parsable as an integer. |
java.lang.String |
scriptRequest(Context context)
An integer widget does nothing clever without it's script |
| Methods inherited from class uk.co.weft.htform.Widget |
clone, generate, generateAttributes, generateAttributes, generateHTML, generateHTMLPrompt, generateInnerHTML, generateValue, generateXML, getContextAttribute, getCssClass, getHeight, getHelp, getName, getPrompt, getTabPlaces, getType, getWidth, init, layout, layout, layout, layout, layoutAttribute, layoutAttributes, layoutValue, makeReady, maybeLayout, maybeLayout, onloadRequest, onloadRequest, postProcess, scriptRequest, setAttribute, setContextAttribute, setCssClass, setDebug, setDefault, setHelp, setImmutable, setMandatory, setMandatory, setName, setPrompt, setSize, setType |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
iw_size
protected int iw_size
- my size
IntegerWidget
public IntegerWidget()
- If you use this constructor, you are strongly advised to use the init()
method.
- See Also:
Widget.init(Context)
IntegerWidget
public IntegerWidget(java.lang.String myname)
- minimum initialisation is I must have a name
IntegerWidget
public IntegerWidget(java.lang.String myname,
java.lang.String myprompt)
- name and prompt is better
IntegerWidget
public IntegerWidget(java.lang.String myname,
java.lang.String myprompt,
java.lang.String myhelp)
- name, prompt and helptext is better still.
scriptRequest
public java.lang.String scriptRequest(Context context)
throws java.lang.Exception
- An integer widget does nothing clever without it's script
- Overrides:
scriptRequest in class Widget
- Returns:
- a comma separated list of JavaScript files which must be loaded
to support this widget
- Throws:
java.lang.Exception
preProcess
protected void preProcess(Context context)
throws DataStoreException,
javax.servlet.ServletException
- Check that the value, if present, is parsable as an integer.
- Overrides:
preProcess in class Widget
- Parameters:
context - the Context of the service in which I'm called
- Throws:
DataFormatException - if data fails validation test
javax.servlet.ServletException - if the thing itself breaks
DataStoreException