objectivehtml.htmlwidget
Class HtmlTextArea

java.lang.Object
  |
  +--objectivehtml.oms.OMSObject
        |
        +--objectivehtml.htmlwidget.HtmlElement
              |
              +--objectivehtml.htmlwidget.HtmlWidget
                    |
                    +--objectivehtml.htmlwidget.HtmlControlWidget
                          |
                          +--objectivehtml.htmlwidget.HtmlTextArea

public class HtmlTextArea
extends HtmlControlWidget

This class represents a html text area. i.e.

<textarea ... >

This widget allows users to enter textual data. Its similar to the HtmlTextBox but differs in that it can cater for multiple lines of text. You can set the size of text area by setting the number of columns and rows.

Both the HtmlTextBox and this class support the read-only mode. This can be used to display text that is not be modifiable.

If auto-escape is turned on then the text part of the object will be escaped before being written out by the HtmlUtils.htmlSpecialChars(String) method.

The widget emits these signals:

See Also:
HtmlTextBox, getText(), HtmlUtils.htmlSpecialChars(String)

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
HtmlTextArea(HtmlContainerWidget objParent, java.lang.String sName)
          Constructs a new instance of HtmlTextArea with the specified parent and control name.
 
Method Summary
 java.lang.String getCols()
          Returns the number of columns for the text area.
 java.lang.String getRows()
          Returns the number of rows for the text area.
 java.lang.String getText()
          Returns the text of this object.
 boolean isReadOnly()
          Returns true if the text area is in read-only mode, false otherwise
 void printHtml(javax.servlet.jsp.JspWriter objWriter, int nOutputType)
          Prints the html that represents this object to the output stream.
 void printHtml(java.io.PrintWriter objWriter, int nOutputType)
          Prints the html that represents this object to the output stream.
 void setCols(java.lang.String sCols)
          Sets the number of columns for the text area.
 void setReadOnly(boolean bReadOnly)
          Sets the text area to be either read-only or read-write mode.
 void setRows(java.lang.String sRows)
          Sets the number of rows for the text area.
 void setText(java.lang.String sText)
          Sets the text of this object.
 Signal textChanged(java.lang.String sNewText, java.lang.String sOldText)
          This signal is emitted when the text of the text area is changed.
 void updateData(javax.servlet.http.HttpServletRequest objRequest)
          Updates this object with the data submitted from the client.
 
Methods inherited from class objectivehtml.htmlwidget.HtmlControlWidget
dataSubmitted, dataSubmitted, destroy, getName, getOnBlur, getOnChange, getOnFocus, getOnSelect, getSubmittedData, getSubmittedDataSet, getTabIndex, getUpdateOrder, isAutoEscape, isAutoUpdate, isDisabled, setAttribute, setAutoEscape, setAutoUpdate, setBooleanAttribute, 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, 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

HtmlTextArea

public HtmlTextArea(HtmlContainerWidget objParent,
                    java.lang.String sName)
             throws InvalidControlNameException,
                    InvalidParentWidgetException,
                    InvalidChildWidgetException
Constructs a new instance of HtmlTextArea with the specified parent and control name.
Parameters:
objParent - the parent of this widget
sName - the unique control name for the object
Throws:
InvalidControlNameException - if the control name is not valid
InvalidParentWidgetException - if the specified parent widget is not valid
InvalidChildWidgetException - if the parent widget does not accept this widget as a child
Method Detail

getText

public java.lang.String getText()
Returns the text of this object.
Returns:
the text
See Also:
setText(String)

setText

public void setText(java.lang.String sText)
Sets the text of this object. i.e. <textarea ...>Text</textarea>
Parameters:
sText - the text
See Also:
getText()

getRows

public java.lang.String getRows()
Returns the number of rows for the text area.
Returns:
the rows for the text area
See Also:
setRows(String)

setRows

public void setRows(java.lang.String sRows)

Sets the number of rows for the text area.

The html attribute it sets is "rows".

If null is specified the attribute is cleared.

Parameters:
sRows - the rows for this widget, if null is specified then this attribute will be cleared
See Also:
getRows()

getCols

public java.lang.String getCols()
Returns the number of columns for the text area.
Returns:
the columns for the text area
See Also:
setCols(String)

setCols

public void setCols(java.lang.String sCols)

Sets the number of columns for the text area.

The html attribute it sets is "columns".

If null is specified the attribute is cleared.

Parameters:
sCols - the rows for this widget, if null is specified then this attribute will be cleared
See Also:
getCols()

setReadOnly

public void setReadOnly(boolean bReadOnly)

Sets the text area 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.

Parameters:
bReadOnly - true if read-only, false if read-write
See Also:
HtmlControlWidget.setBooleanAttribute(String, boolean), isReadOnly()

isReadOnly

public boolean isReadOnly()
Returns true if the text area is in read-only mode, false otherwise
Returns:
true if read-only, false if read-write
See Also:
HtmlElement.getBooleanAttribute(String), setReadOnly(boolean)

updateData

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.

Overrides:
updateData in class HtmlControlWidget
Parameters:
objRequest - the request object that contains the user submitted data
See Also:
getText(), HtmlWidget.isVisible(), HtmlControlWidget.isDisabled(), HtmlControlWidget.isAutoUpdate(), HtmlControlWidget.getSubmittedData(HttpServletRequest)

textChanged

public Signal textChanged(java.lang.String sNewText,
                          java.lang.String sOldText)
This signal is emitted when the text of the text area is changed.
Parameters:
sNewText - the new text
sOldText - the old text
Returns:
the signal object

printHtml

public void printHtml(java.io.PrintWriter objWriter,
                      int nOutputType)
               throws java.io.IOException
Prints the html that represents this object to the output stream.
Overrides:
printHtml in class HtmlControlWidget
Parameters:
objWriter - the output stream for a Servlet object
nOutputType - the output type

printHtml

public void printHtml(javax.servlet.jsp.JspWriter objWriter,
                      int nOutputType)
               throws java.io.IOException
Prints the html that represents this object to the output stream.
Overrides:
printHtml in class HtmlControlWidget
Parameters:
objWriter - the output stream for a Jsp page
nOutputType - the output type