|
|||||||||
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.HtmlContainerWidget | +--objectivehtml.htmlwidget.HtmlUnrestrictedContainerWidget | +--objectivehtml.htmlwidget.HtmlForm
This class represents a html form. i.e.
<form ... >
It is the top-most object in the object hierarchy. An instance of this class must be created first before any other HtmlWidget objects can exist. The widget has no visual presentation but contains submission properties and also can provide properties to its children.
All forms have an action and method type. The action is a URL address and is used by the server to determine what action to perform. The method determines the protocol the form will use to submit data to the server. The typical values are "post" and "get" (default).
This object keeps a list of all the control names used in this form and ensures HtmlControlWidget objects have a unique name.
The widget emits these signals:
Field Summary | |
static java.lang.String |
GET
This constant represents the "get" submission method. |
static java.lang.String |
POST
This constant represents the "post" submisison method. |
Fields inherited from class objectivehtml.htmlwidget.HtmlContainerWidget |
m_alChildrenWidgets, m_bAutoEscape, m_sText |
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 | |
HtmlForm()
Constructs an instance of a HtmlForm. |
Method Summary | |
protected void |
addControlName(java.lang.String sName)
Adds a new control name to the form. |
protected void |
addRadioButton(HtmlRadioButton objRadioButton)
Adds a new HtmlRadioButton object to the form. |
Signal |
afterUpdateData(javax.servlet.http.HttpServletRequest objRequest)
This signal is emitted just after the updateData(HttpServletRequest) method updates all the form object with the submitted data. |
Signal |
beforeUpdateData(javax.servlet.http.HttpServletRequest objRequest)
This signal is emitted just before the updateData(HttpServletRequest) method updates all the form object with the submitted data. |
java.lang.String |
getAction()
Returns the action of this object. |
java.lang.String |
getMethod()
Returns the method of this object. |
java.lang.String |
getName()
Returns the method of this object. |
protected HtmlRadioButtonGroup |
getRadioButtonGroup(java.lang.String sGroupName)
Returns a reference to the radio button group with the specified name. |
protected void |
removeControlName(java.lang.String sName)
Removes a control name from the form. |
protected void |
removeRadioButton(HtmlRadioButton objRadioButton)
Removes a HtmlRadioButton object from the form. |
void |
setAction(java.lang.String sAction)
Sets the action of this form. |
void |
setMethod(java.lang.String sMethod)
Sets the submit method of this form. |
void |
setName(java.lang.String sName)
Sets the name of this form. |
void |
updateData(javax.servlet.http.HttpServletRequest objRequest)
Updates all HtmlControlWidget objects with the data submitted from the client. |
Methods inherited from class objectivehtml.htmlwidget.HtmlUnrestrictedContainerWidget |
appendChild, destroy, insertChild, setVisible |
Methods inherited from class objectivehtml.htmlwidget.HtmlContainerWidget |
addHtmlWidget, generateUpdateOrder, getChildrenCount, getChildrenWidgets, getChildWidget, getText, indexOfChildWidget, insertHtmlWidget, isAutoEscape, isChildWidget, isValidChildWidget, printHtml, printHtml, removeHtmlWidget, setAttribute, setAutoEscape, setBooleanAttribute, setText, swapHtmlWidgets |
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, setAttribute, setBooleanAttribute, 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 |
Field Detail |
public static final java.lang.String GET
public static final java.lang.String POST
Constructor Detail |
public HtmlForm()
Method Detail |
protected HtmlRadioButtonGroup getRadioButtonGroup(java.lang.String sGroupName)
sGroupName
- the radio button group nameprotected void removeRadioButton(HtmlRadioButton objRadioButton)
Removes a HtmlRadioButton object from the form.
If the group for this radio button has other radio buttons then the control name and the group will remain. If the radio button is the last radio button in the group then the control name will be removed and the radio group will also be removed.
objRadioButton
- the radio button to removeaddRadioButton(HtmlRadioButton)
protected void addRadioButton(HtmlRadioButton objRadioButton) throws InvalidControlNameException
Adds a new HtmlRadioButton object to the form.
If the group of the radio button already exists then it will be added to the group, otherwise a new radio button group is created.
objRadioButton
- the radio button to addInvalidControlNameException
- if the control name is not validremoveRadioButton(HtmlRadioButton)
protected void addControlName(java.lang.String sName) throws InvalidControlNameException
sName
- the control name to addInvalidControlNameException
- if the control name is not validremoveControlName(String)
protected void removeControlName(java.lang.String sName)
sName
- the control name to removeaddControlName(String)
public void setMethod(java.lang.String sMethod)
Sets the submit method of this form. The 2 typical values are "post" and "get" (default).
The html attribute it sets is "method".
If null is specified the attribute is cleared.
sMethod
- the method for this elementHtmlElement.setAttribute(String, String)
,
getMethod()
,
GET
,
POST
public java.lang.String getMethod()
setMethod(String)
,
HtmlElement.getAttribute(String)
public void setName(java.lang.String sName)
Sets the name of this form. The name is used in the client-side scripting code to reference this form.
The html attribute it sets is "name".
If null is specified the attribute is cleared.
sName
- the name for this elementHtmlElement.setAttribute(String, String)
,
getName()
public java.lang.String getName()
setMethod(String)
,
HtmlElement.getAttribute(String)
public void setAction(java.lang.String sAction)
Sets the action of this form. The action should be a URL, the server will use this to determine the action to be performed.
The html attribute it sets is "action".
If null is specified the attribute is cleared.
sName
- the name for this elementHtmlElement.setAttribute(String, String)
,
getAction()
public java.lang.String getAction()
setAction(String)
,
HtmlElement.getAttribute(String)
public void updateData(javax.servlet.http.HttpServletRequest objRequest)
objRequest
- the request object that contains the user submitted dataHtmlControlWidget.updateData(HttpServletRequest)
,
beforeUpdateData(HttpServletRequest)
,
afterUpdateData(HttpServletRequest)
public Signal beforeUpdateData(javax.servlet.http.HttpServletRequest objRequest)
objRequest
- the request object that contains the user submitted dataupdateData(HttpServletRequest)
public Signal afterUpdateData(javax.servlet.http.HttpServletRequest objRequest)
objRequest
- the request object that contains the user submitted dataupdateData(HttpServletRequest)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |