|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--objectivehtml.oms.OMSObject | +--objectivehtml.htmlwidget.HtmlElement | +--objectivehtml.htmlwidget.HtmlWidget | +--objectivehtml.htmlwidget.HtmlControlWidget | +--objectivehtml.htmlwidget.HtmlInput | +--objectivehtml.htmlwidget.HtmlTextBox
This class represents a html text box. i.e.
<input type="text|password" ...>
This widget allows users to enter textual data. Its similar to the HtmlTextArea but differs in that it only offers one line of data entry. You can specify the size of the object by setting the "size" attribute. You can specify the maximum number of characters that can be entered by setting the "maxlength" attribute.
The widget offers a normal text mode (default) and a password mode. In password mode all characters typed into the data area are shadowed with an asterix character '*'.
Both the HtmlTextArea and this class support the read-only mode. This can be used to display text that is not be modifiable.
The widget emits these signals:
HtmlTextArea
Fields inherited from class objectivehtml.htmlwidget.HtmlControlWidget |
m_bAutoEscape, m_bAutoUpdate |
Fields inherited from class objectivehtml.htmlwidget.HtmlWidget |
m_bDestroyed, m_bVisible, m_objHtmlForm, m_objParentWidget |
Fields inherited from class objectivehtml.htmlwidget.HtmlElement |
m_hmAttributes, m_sEndTag, m_sQuoteType, m_sStartTag |
Constructor Summary | |
HtmlTextBox(HtmlContainerWidget objParent,
java.lang.String sName)
Constructs a new instance of HtmlTextBox with the specified parent and control name. |
Method Summary | |
java.lang.String |
getMaxLength()
Returns the maximum length of the text box. |
java.lang.String |
getSize()
Returns the size of the text box. |
boolean |
isPassword()
Returns whether the text box is in password mode. |
boolean |
isReadOnly()
Returns true if the text box is in read-only mode, false otherwise |
void |
setMaxLength(java.lang.String sMaxLength)
Sets the maximum length of the text box. |
void |
setPassword(boolean bPassword)
Sets the text box to be in password-mode or text-mode. |
void |
setReadOnly(boolean bReadOnly)
Sets the text box to be either read-only or read-write mode. |
void |
setSize(java.lang.String sSize)
Sets the size of the text box. |
void |
updateData(javax.servlet.http.HttpServletRequest objRequest)
Updates this object with the data submitted from the client. |
Methods inherited from class objectivehtml.htmlwidget.HtmlInput |
genStartTag, getText, getType, getValue, setAttribute, setBooleanAttribute, setText, setType, setValue, valueChanged |
Methods inherited from class objectivehtml.htmlwidget.HtmlControlWidget |
dataSubmitted, dataSubmitted, destroy, getName, getOnBlur, getOnChange, getOnFocus, getOnSelect, getSubmittedData, getSubmittedDataSet, getTabIndex, getUpdateOrder, isAutoEscape, isAutoUpdate, isDisabled, printHtml, printHtml, setAutoEscape, setAutoUpdate, setDisabled, setOnBlur, setOnChange, setOnFocus, setOnSelect, setTabIndex, setUpdateOrder, setVisible |
Methods inherited from class objectivehtml.htmlwidget.HtmlWidget |
changeParent, changeParent, getClassAttribute, getHtmlForm, getID, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getParent, getStyle, isDestroyed, isVisible, setClassAttribute, setID, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStyle |
Methods inherited from class objectivehtml.htmlwidget.HtmlElement |
genEndTag, genStartTag, getAttribute, getAttributes, getBooleanAttribute, getQuoteType, printHtml, printHtml, printHtml, printHtml, printHtml, printHtml, setQuoteType, toString, toString |
Methods inherited from class objectivehtml.oms.OMSObject |
compareClasses, connect, disconnect, emit, isAlive, setAlive, signal, slot, slot |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HtmlTextBox(HtmlContainerWidget objParent, java.lang.String sName) throws InvalidControlNameException, InvalidParentWidgetException, InvalidChildWidgetException
objParent
- the parent of this widgetsName
- the unique control name for the objectInvalidControlNameException
- if the control name is not validInvalidParentWidgetException
- if the specified parent widget is not validInvalidChildWidgetException
- if the parent widget does not accept this widget as a childMethod Detail |
public void setPassword(boolean bPassword)
bPassword
- true if password-mode, false if text-modeisPassword()
public boolean isPassword()
setPassword(boolean)
public java.lang.String getSize()
setSize(String)
public void setSize(java.lang.String sSize)
Sets the size of the text box. The width of the text box will be based on the size specified. This will depend on each browser, but generally the actual width will be determined by multiplying the pixel width of a standard character with the size specified.
The html attribute it sets is "size".
If null is specified the attribute is cleared.
sSize
- the size for this widget,
if null is specified then this attribute
will be clearedgetSize()
public java.lang.String getMaxLength()
setMaxLength(String)
public void setMaxLength(java.lang.String sMaxLength)
Sets the maximum length of the text box. When this attribute is set then the text box is limited to only having at most this number of characters. If this attribute is not set then there is no limit on the number of characters than can be entered.
The html attribute it sets is "maxlength".
If null is specified the attribute is cleared.
sMaxLength
- the maxlength for this widget,
if null is specified then this attribute
will be clearedgetMaxLength()
public void setReadOnly(boolean bReadOnly)
Sets the text box to be either read-only or read-write mode. In read-only mode the text area becomes unmodifiable.
The html attribute it sets is "readonly".
If false is specified the attribute is cleared.
bReadOnly
- true if read-only, false if read-writeHtmlInput.setBooleanAttribute(String, boolean)
,
isReadOnly()
public boolean isReadOnly()
HtmlElement.getBooleanAttribute(String)
,
setReadOnly(boolean)
public void updateData(javax.servlet.http.HttpServletRequest objRequest)
Updates this object with the data submitted from the client. It will update the text (using setText(String)) of this object with the data submitted.
The object will only be updated if the auto-update is on and if the object is visible and not disabled and not in read-only mode.
updateData
in class HtmlControlWidget
objRequest
- the request object that contains the user submitted dataHtmlInput.getText()
,
HtmlWidget.isVisible()
,
HtmlControlWidget.isDisabled()
,
HtmlControlWidget.isAutoUpdate()
,
HtmlControlWidget.getSubmittedData(HttpServletRequest)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |