com.iplanet.jato.view.html
Class Button

java.lang.Object
  |
  +--com.iplanet.jato.view.ViewBase
        |
        +--com.iplanet.jato.view.DisplayFieldImpl
              |
              +--com.iplanet.jato.view.CommandFieldBase
                    |
                    +--com.iplanet.jato.view.html.Button
All Implemented Interfaces:
CommandField, DisplayField, HtmlDisplayField, View

public class Button
extends CommandFieldBase
implements HtmlDisplayField

The Button encapsulates and implements the server-side representation of an HTML button. This class is derived from CommandFieldBase. CommandFieldBase performs much of the base functionality of this class.

This class controls the button specific details of implementing a command objects ability to automatically pass extra source values out during the display cycle and map these source values to target objects during the submit cycle.

The extra values are be passed as automatically generated hidden fields that are inserted into the HTML document directly following the button's own HTML.

Version:
JATO/1.2.2 $Id: Button.java,v 1.17 2002/03/16 03:26:43 todd Exp $
See Also:
CommandFieldBase

Fields inherited from interface com.iplanet.jato.view.html.HtmlDisplayField
QBE_CONTROL_NAME_SUFFIX
 
Fields inherited from interface com.iplanet.jato.view.View
QUALIFIED_VIEW_NAME_SEPARATOR
 
Constructor Summary
Button(ContainerView parent, java.lang.String name, java.lang.Object value)
          Construct a display field with the specified properties.
Button(ContainerView parent, java.lang.String name, java.lang.String boundName, java.lang.Object value)
          Construct a display field with the specified properties.
Button(View parent, Model model, java.lang.String name, java.lang.Object value)
          Construct a display field with the specified properties
Button(View parent, Model model, java.lang.String name, java.lang.String boundName, java.lang.Object value)
          Construct a display field with the specified properties
Button(View parent, Model model, java.lang.String name, java.lang.String boundName, java.lang.Object value, CommandFieldDescriptor descriptor)
          Construct a display field with the specified properties
 
Method Summary
 java.lang.String getExtraHtml()
          Returns the string representing any arbitrary "extra HTML" for this field
static java.lang.String getSourceTargetParameterName(java.lang.String childName, int position)
          Returns the name of the hidden field that will be used to store a given CommandSourceTargetPair's source value
protected  java.lang.Object getSourceValue(CommandSourceTargetPair nextPair, int position)
          Returns a source value for a given CommandSourceTargetPair.
 void setExtraHtml(java.lang.String value)
          Supplies a string representing any arbitrary "extra HTML" which will be appended to the standard HTML generated by this field.
 
Methods inherited from class com.iplanet.jato.view.CommandFieldBase
addExtraValue, beforeCommand, clearExtraValues, getCommandFieldDescriptor, getDisplayField, getExtraValuesMap, mapSourceTargetNVPs, mapSourceTargetValues, removeExtraValue, setExtraValuesMap
 
Methods inherited from class com.iplanet.jato.view.DisplayFieldImpl
getBoundName, getDescriptor, getModel, getValue, getValues, setBoundName, setDescriptor, setModel, setValue, setValue, setValues, setValues, stringValue
 
Methods inherited from class com.iplanet.jato.view.ViewBase
getName, getParent, getParentViewBean, getQualifiedName, getRootView, getRootView, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.iplanet.jato.view.DisplayField
getDescriptor, getValue, getValues, setValue, setValues, stringValue
 
Methods inherited from interface com.iplanet.jato.view.View
getName, getParent, getQualifiedName, setParent
 

Constructor Detail

Button

public Button(ContainerView parent,
              java.lang.String name,
              java.lang.Object value)
Construct a display field with the specified properties. The field will be bound to the parent's default model.
Parameters:
parent - The parent view of this object
name - This view's name and model field bound name
value - This DiplayField's initial value.

Button

public Button(ContainerView parent,
              java.lang.String name,
              java.lang.String boundName,
              java.lang.Object value)
Construct a display field with the specified properties. The field will be bound to the parent's default model.
Parameters:
parent - The parent view of this object
name - This view's name
boundName - The name of the model field to which this DisplayField is bound
value - This DiplayField's initial value.

Button

public Button(View parent,
              Model model,
              java.lang.String name,
              java.lang.Object value)
Construct a display field with the specified properties
Parameters:
parent - The parent view of this object
model - The model to which this DisplayField is bound
name - This view's name and model field bound name
value - This DiplayField's initial value.

Button

public Button(View parent,
              Model model,
              java.lang.String name,
              java.lang.String boundName,
              java.lang.Object value)
Construct a display field with the specified properties
Parameters:
parent - The parent view of this object
model - The model to which this DisplayField is bound
name - This view's name.
boundName - The name of the model field to which this DisplayField is bound
value - This DiplayField's initial value.

Button

public Button(View parent,
              Model model,
              java.lang.String name,
              java.lang.String boundName,
              java.lang.Object value,
              CommandFieldDescriptor descriptor)
Construct a display field with the specified properties
Parameters:
parent - The parent view of this object
model - The model to which this DisplayField is bound
name - This view's name.
boundName - The name of the model field to which this DisplayField is bound
value - This DiplayField's initial value.
descriptor - This DisplayField's DisplayFieldDescriptor. May be null.
Method Detail

getExtraHtml

public java.lang.String getExtraHtml()
Returns the string representing any arbitrary "extra HTML" for this field
Specified by:
getExtraHtml in interface HtmlDisplayField
Returns:
the extra HTML string

setExtraHtml

public void setExtraHtml(java.lang.String value)
Supplies a string representing any arbitrary "extra HTML" which will be appended to the standard HTML generated by this field.
Parameters:
value - The arbitrary string of "extra HTML".

getSourceValue

protected java.lang.Object getSourceValue(CommandSourceTargetPair nextPair,
                                          int position)
Returns a source value for a given CommandSourceTargetPair. This method is automatically called as part of the submit cycle. Depending on the source value type, the value will either be retrieved from a hidden field (i.e. static text and data field values) or it will be retrieved from its logical submit cycle location (i.e. input field values are fetched from the respective input fields and session values are fetched from session).
Overrides:
getSourceValue in class CommandFieldBase
Parameters:
nextPair - The CommandSourceTargetPair whose source value is being retrieved
position - The position of the CommandSourceTargetPair within the list of CommandSourceTargetPairs.
Returns:
The value corresponding to the source member of the CommandSourceTargetPair

getSourceTargetParameterName

public static java.lang.String getSourceTargetParameterName(java.lang.String childName,
                                                            int position)
Returns the name of the hidden field that will be used to store a given CommandSourceTargetPair's source value
Parameters:
position - The position of the CommandSourceTargetPair within the list of CommandSourceTargetPairs.
Returns:
The name of the requested CommandSourceTargetPair's source parameter