|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pajes.html.Tag
org.pajes.html.Input
Base Class for all form input elements. This class provides the default methods applicable to all for input elements.
| Field Summary | |
protected static java.lang.String |
TYPE_ATTRIBUTE
The type attribute name. |
| Fields inherited from class org.pajes.html.Tag |
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT |
| Constructor Summary | |
Input(java.lang.String type)
Creates an input field. |
|
| Method Summary | |
void |
addClientValidation(ValidationFunction rule)
Adds a client validation rule for this input element. |
void |
addContent(java.lang.String content)
Sets the value attribute of this INPUT tag. |
java.lang.Object |
clone()
Performs a deep clone, cloning and replacing the validation functions. |
ValidationFunction[] |
getClientValidation()
Returns all the client validation rules defined for this input element. |
java.lang.String |
getClientValidation(Browser browser)
Returns the client validation rules applicable to this input element as a string. |
java.lang.String |
getDOMReference(Browser browser)
Returns the Document Object Model reference for the INPUT element. |
java.lang.String |
getFieldNameForErrorMessage()
Returns the name of the field to display in an error message. |
Form |
getForm()
Returns the form reference of this INPUT element. |
static Input |
getInstance(Form form,
java.lang.String name,
int dataType)
Creates an appropriate Input instance to handle the specified SQL data type. |
Label |
getLabel()
Returns the Label associated with this Input element. |
java.lang.String |
getName()
Returns the name attribute of this input element. |
java.lang.String |
getOnBlurHandler(Browser browser)
Returns the JavaScript handler for return this.event. |
java.lang.String |
getOnChangeHandler(Browser browser)
Returns the JavaScript handler for return this.event. |
java.lang.String |
getOnFocusHandler(Browser browser)
Returns the JavaScript handler for return this.event. |
java.lang.String |
getOnSelectHandler(Browser browser)
Returns the JavaScript handler for return this.event. |
java.lang.String |
getReadOnlyStyleSheetClass()
Returns the CLASS attribute of the tag when this Input element is defined as read-only. |
java.lang.Integer |
getTabIndex()
Returns the position of this element in the tabbing order, or null if no position has been assigned. |
java.lang.String |
getType()
Returns the type attribute of this input element. |
java.lang.String |
getValue()
Returns the value attribute of this INPUT element. |
boolean |
isChangeFlagEnabled()
Determines whether the JavaScript flag to indicate that a form has been changed will be set when this item is changed. |
boolean |
isDisabled()
Determines if this element is disabled. |
boolean |
isReadOnly()
Determines if this element is read-only. |
boolean |
isRequiringValidation()
Determines if this element requires validation. |
protected void |
logNoFormWarning(Browser browser)
Logs a detailed warning message when an Input element appers outside a Form. |
void |
removeClientValidation()
Removes all validation rules. |
void |
removeClientValidation(java.lang.String className)
Removes any validation rule that is a matching instance of the specified ValidationFunction. |
void |
removeClientValidation(ValidationFunction instance)
Removes any validation rule that is a matching instance of the specified ValidationFunction. |
void |
removeMandatoryClientValidation()
Remove the mandatory rule from any input validation defined for this input element. |
protected void |
setChanged(Browser browser)
Called by the write(org.pajes.servlet.Browser)method to set the changed JavaScript flag
variable to true |
Input |
setChangedFlag(boolean on)
Sets whether the JavaScript flag to indicate that a form has been changed will be set when this item is changed. |
void |
setContent(java.lang.String content)
Sets the value attribute of this INPUT tag. |
Input |
setDisabled(boolean disabled)
Sets whether this field is disabled or not. |
Input |
setFieldNameInErrorMessage(Container container)
Sets the field name to be displayed in any error messages, by extracting the contents of a specified container instance. |
Input |
setFieldNameInErrorMessage(java.lang.String fieldName)
Sets the field name to be displayed in any error messages. |
Input |
setForm(Form form)
Sets the form on which this INPUT element will appear. |
Tag |
setId(java.lang.String id)
Sets the ID attribute of the current tag. |
Input |
setLabel(Label label)
Sets the Label associated with this Input element. |
Input |
setName(java.lang.String name)
Sets the name of this INPUT tag. |
Input |
setOnBlurHandler(java.lang.String onBlurHandler)
Sets the JavaScript handler for this event. |
Input |
setOnBlurValidation(boolean validateOnBlur)
Turns on or off validation on field blur. |
Input |
setOnChangeHandler(java.lang.String onChangeHandler)
Sets the JavaScript handler for this event. |
Tag |
setOnClickHandler(java.lang.String onClickHandler)
Sets the JavaScript handler for this event. |
Input |
setOnFocusHandler(java.lang.String onFocusHandler)
Sets the JavaScript handler for this event. |
Input |
setOnSelectHandler(java.lang.String onSelectHandler)
Sets the JavaScript handler for this event. |
Input |
setReadOnly(boolean readOnly)
Sets whether this field is read only or not. |
Input |
setReadOnlyStyleSheetClass(java.lang.String styleSheetClass)
Sets the CLASS attribute of the tag when this Input element is defined as read-only. |
Input |
setTabIndex(int position)
Sets the position of this element in the tabbing order. |
Input |
setTabIndex(java.lang.Integer position)
Sets the position of this element in the tabbing order. |
Input |
setTabIndex(java.lang.String position)
Sets the position of this element in the tabbing order. |
Input |
setValue(java.lang.String value)
Sets the value attribute of this INPUT tag. |
void |
write(Browser browser)
Writes the <input> tag to the browser. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final java.lang.String TYPE_ATTRIBUTE
type attribute name.
| Constructor Detail |
public Input(java.lang.String type)
type - the type attribute of the <input> tag.| Method Detail |
public boolean isChangeFlagEnabled()
public Input setChangedFlag(boolean on)
on - true if this form element will participate in the check for
changed fields, or false if not.
public ValidationFunction[] getClientValidation()
public java.lang.String getClientValidation(Browser browser)
browser - the browser to which the output is being sent.
public void setContent(java.lang.String content)
setContent in interface HTMLsetContent in class Tagcontent - the value to assign.Tag.getContent(),
Tag.setContent(org.pajes.html.HTML)public java.lang.String getDOMReference(Browser browser)
browser - the browser to which the reference refers.
TagException - if the form or name have not beed defined.public Input setDisabled(boolean disabled)
disabled - true if the field is to be disabled, or false if it is active.
public boolean isDisabled()
public java.lang.String getFieldNameForErrorMessage()
public Input setFieldNameInErrorMessage(java.lang.String fieldName)
fieldName - is the name of the field to display in the error message.
public Input setFieldNameInErrorMessage(Container container)
container - the Container instance which contains the field name to be
displayed.
public Input setForm(Form form)
form - the form on which this INPUT element will appear.
public Form getForm()
public static Input getInstance(Form form,
java.lang.String name,
int dataType)
form - the form on which the INPUT element will appear.name - the name to apply to the input object.dataType - the SQL data type (from java.sql.Types).
public Tag setId(java.lang.String id)
Tag
setId in class Tagid - the unique ID of the tag
Tag.setId(java.lang.String)public Input setLabel(Label label)
label - the Label associated with this Input element.
public Label getLabel()
public Input setName(java.lang.String name)
name - the name to apply to the input object.
public java.lang.String getName()
public Input setOnBlurHandler(java.lang.String onBlurHandler)
onBlurHandler - The new onBlurHandler value
public java.lang.String getOnBlurHandler(Browser browser)
browser - the browser to which the output is being sent.
public Input setOnBlurValidation(boolean validateOnBlur)
validateOnBlur - true if validation of this field should occur on loss of
focus.
public Input setOnChangeHandler(java.lang.String onChangeHandler)
onChangeHandler - The new onChangeHandler value
TagException - if this input type is not a field.public java.lang.String getOnChangeHandler(Browser browser)
browser - the browser to which the output is being sent.
public Tag setOnClickHandler(java.lang.String onClickHandler)
setOnClickHandler in class TagonClickHandler - The new onClickHandler value
TagException - if this input type is a field.public Input setOnFocusHandler(java.lang.String onFocusHandler)
onFocusHandler - The new onFocusHandler value
public java.lang.String getOnFocusHandler(Browser browser)
browser - the browser to which the output is being sent.
public Input setOnSelectHandler(java.lang.String onSelectHandler)
onSelectHandler - The new onSelectHandler value
public java.lang.String getOnSelectHandler(Browser browser)
browser - the browser to which the output is being sent.
public Input setReadOnly(boolean readOnly)
readOnly - true if the field is to be read-only, or false if it is able
to be edited.
public boolean isReadOnly()
public Input setReadOnlyStyleSheetClass(java.lang.String styleSheetClass)
read-only. The class will only be applied if no
class has previously been defined.
If not specified, the default class name will "readOnlyInput".
styleSheetClass - The new read-only style sheet class attribute.
public java.lang.String getReadOnlyStyleSheetClass()
read-only. The class will only be applied if no
class has previously been defined.
public boolean isRequiringValidation()
public Input setTabIndex(int position)
position - the position of this element in the tabbing order. This value
must be greater than or equal to zero.
public Input setTabIndex(java.lang.Integer position)
position - the position of this element in the tabbing order. This value
must be greater than or equal to zero. It may slo be null, in
which case the attribbute will be cleared.
public Input setTabIndex(java.lang.String position)
position - the position of this element in the tabbing order. This value
must be greater than or equal to zero. It may slo be null, in
which case the attribbute will be cleared.
public java.lang.Integer getTabIndex()
public java.lang.String getType()
public Input setValue(java.lang.String value)
value - the value to assign.
public java.lang.String getValue()
public void addClientValidation(ValidationFunction rule)
rule - The feature to be added to the ClientValidation attributepublic void addContent(java.lang.String content)
HTML.setContent(java.lang.String) but meaningless in this context.)
addContent in interface HTMLaddContent in class Tagcontent - the value to assign.setContent(java.lang.String)public java.lang.Object clone()
clone in interface HTMLclone in class Tagpublic void removeClientValidation()
public void removeClientValidation(ValidationFunction instance)
instance - the specifed instance will be compared to all existing rules
and if any matching classes are found they will be removed.public void removeClientValidation(java.lang.String className)
className - the specifed class name will be compared to all existing rules
and if any matching classes are found they will be removed.public void removeMandatoryClientValidation()
public void write(Browser browser)
throws java.io.IOException
write in interface HTMLwrite in class Tagbrowser - the browser to which the results are to be output.
java.io.IOException - if an I/O error occurs writing to the browser.Tag.setWriteEndTag(boolean),
Tag.writeContent(org.pajes.servlet.Browser)protected void setChanged(Browser browser)
write(org.pajes.servlet.Browser)method to set the changed JavaScript flag
variable to true
browser - the browser to which the tag is being written.protected void logNoFormWarning(Browser browser)
Form.
browser - the browser to which the page is being written.
|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||