|
|||||||||
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.HtmlPushButton
This class represents a html push button. i.e.
<input type="button|submit|reset" ... >
The widget provides users with a pressable button to trigger off an event. There are 3 button types, "button", "submit" and "reset". The "button" type is the generic version of this widget and can be used to trigger off a client-side action. When the button is clicked the "onclick" client-side event will be fired and will execute the scripting code set in the "onclick" attribute. The "submit" type provides a button that when clicked will submit the form data to server. The "reset" type provides a button that when clicked will clear all the form data back to its original values when the form was loaded.
The widget emits these signals:
Field Summary | |
static java.lang.String |
BUTTON
This constant represents the "button" button-type |
static java.lang.String |
RESET
This constant represents the "reset" button-type |
static java.lang.String |
SUBMIT
This constant represents the "submit" button-type |
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 | |
HtmlPushButton(HtmlContainerWidget objParent,
java.lang.String sName)
Constructs an instance of HtmlPushButton.The default of button-type is "button". |
Method Summary | |
void |
clearClickedProxy()
Clears the proxy object and proxy value if they exist. |
Signal |
clicked()
This signal is emitted when the button is clicked. |
java.lang.String |
getButtonType()
Returns the button-type of this push button. |
void |
handleProxyEvent(java.lang.String sProxyData)
This method is used to determine whether the "clicked()" signal should be emitted when the "dataSubmitted(String)" signal is emitted from the proxy object. |
boolean |
isButtonTypeValid(java.lang.String sType)
Checks the type attribute of this object. |
void |
setButtonType(java.lang.String sType)
Sets the button-type for this push button. |
void |
setClickedProxy(HtmlHiddenInput objClickedProxy,
java.lang.String sProxyValue)
Sets the clicked proxy object for this HtmlPushButton. |
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 |
Field Detail |
public static final java.lang.String BUTTON
public static final java.lang.String SUBMIT
public static final java.lang.String RESET
Constructor Detail |
public HtmlPushButton(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 setClickedProxy(HtmlHiddenInput objClickedProxy, java.lang.String sProxyValue)
Sets the clicked proxy object for this HtmlPushButton. The proxy is a HtmlHiddenInput object. When the objClickedProxy object emits the "dataSubmitted(String)" signal and the data is equal to sProxyValue then this object will emit the "clicked()" signal. This provides a way for the "clicked()" signal to be emitted even for a HtmlPushButton object with button-type "button". The actual code for this method is:
m_objClickedProxy = objClickedProxy; m_sProxyValue = sProxyValue; try { connect(slot("handleProxyEvent(String)"), m_objClickedProxy.signal("dataSubmitted(String)")); } // end try catch (InvalidSlotException ise) { ise.printStackTrace(); } // end catch ise
objClickedProxy
- the proxy objectsProxyValue
- the submitted data value that the proxy is bound toclearClickedProxy()
,
handleProxyEvent(String)
public void handleProxyEvent(java.lang.String sProxyData)
This method is used to determine whether the "clicked()" signal should be emitted when the "dataSubmitted(String)" signal is emitted from the proxy object.
sProxyData
- the data submitted by the proxysetClickedProxy(HtmlHiddenInput, String)
public void clearClickedProxy()
Clears the proxy object and proxy value if they exist.
setClickedProxy(HtmlHiddenInput, String)
public void setButtonType(java.lang.String sType) throws InvalidButtonTypeException
Sets the button-type for this push button. The 3 allowed values are "button" (default), "submit" and "reset". Use the constants BUTTON, SUBMIT and RESET.
The "button" type is the generic version of this widget and can be used to trigger off a client-side action. When the button is clicked the "onclick" client-side event will be fired and will execute the scripting code set in the "onclick" attribute. The "submit" type provides a button that when clicked will submit the form data to server. The "reset" type provides a button that when clicked will clear all the form data back to its original values when the form was loaded.
The html attribute it sets is "button".
If null is specified the attribute is cleared.
sType
- the button for this elementHtmlWidget.setOnClick(String)
,
HtmlInput.setAttribute(String, String)
,
getButtonType()
,
BUTTON
,
SUBMIT
,
RESET
public java.lang.String getButtonType()
setButtonType(String)
,
HtmlElement.getAttribute(String)
public boolean isButtonTypeValid(java.lang.String sType)
sType
- the type for this html elementpublic void updateData(javax.servlet.http.HttpServletRequest objRequest)
Updates this object with the data submitted from the client. If the submitted data is not null the value is updated.
The object will only be updated if the auto-update is on and if the object is visible and not disabled.
updateData
in class HtmlControlWidget
objRequest
- the request object that contains the user submitted dataHtmlInput.getValue()
,
HtmlWidget.isVisible()
,
HtmlControlWidget.isDisabled()
,
HtmlControlWidget.isAutoUpdate()
,
HtmlControlWidget.getSubmittedData(HttpServletRequest)
public Signal clicked()
setClickedProxy(HtmlHiddenInput,String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |