com.esri.adf.web.faces.component
Class ButtonControl

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UICommand
              extended by com.esri.adf.web.faces.component.ButtonControl
All Implemented Interfaces:
MapToolAction, ToolAction, Serializable, javax.faces.component.ActionSource, javax.faces.component.ActionSource2, javax.faces.component.StateHolder

public class ButtonControl
extends javax.faces.component.UICommand
implements MapToolAction, Serializable

A button control executes the server side action and/or action listener method for the control its associated with.

See Also:
Serialized Form

Field Summary
static String COMPONENT_FAMILY
          The standard component family for this component.
static String COMPONENT_TYPE
          The standard component type for this component.
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
ButtonControl()
          Instantiates an object of ButtonControl.
 
Method Summary
 void execute(javax.faces.context.FacesContext context)
          Executes the server action associated with this button.
 void execute(MapEvent event)
          Executes the server action associated with this button.
 String getClientAction()
          Gets the client action of the button, should be a JavaScript method.
 String getCollectionId()
          Gets the collectionId of the ButtonControl.
 String getDefaultImage()
          Returns the default image that is set for this control.
 String getFamily()
          Returns the family of this control.
 String getHoverImage()
          Returns the hover image that is set for this control.
 String getMapId()
          Returns the map control id associated with the control.
 String getOnclick()
          Gets the onclick event of the button.
 String getSelectedImage()
          Gets the selected image that is set for this control.
 String getServerAction()
          Gets the server action of the button, should be a backing bean method.
 String getStyle()
          Gets the CSS style of the button.
 String getStyleClass()
          Gets the CSS style class of the ButtonControl.
 String getToolTip()
          Gets the toolTip of the button.
 String getType()
          Gets the type of the button.
 String getValue()
          Gets the text value of the button.
 boolean isDisabled()
          Returns true if the button is disabled.
 void registerMapToolItem(javax.faces.context.FacesContext facesContext)
          Registers the button as a MapToolItem.
 void restoreState(javax.faces.context.FacesContext facesContext, Object state)
           
 Object saveState(javax.faces.context.FacesContext facesContext)
           
 void setClientAction(String clientAction)
          Sets the client action of the button, should be a JavaScript method.
 void setCollectionId(String collectionId)
          Sets the collectionId of the ButtonControl.
 void setDefaultImage(String defaultImage)
          Sets the default image that is set for this control.
 void setDisabled(boolean disabled)
          Sets to true if the button is disabled.
 void setHoverImage(String hoverImage)
          Sets the hover image that is set for this control.
 void setMapId(String mapId)
          Sets the map control id associated with the control.
 void setOnclick(String onclick)
          Sets the onclick event of the button.
 void setSelectedImage(String selectedImage)
          Sets the selected image that is set for this control.
 void setServerAction(String serverAction)
          Sets the server action of the button, should be a backing bean method.
 void setStyle(String style)
          Sets the CSS style of the button.
 void setStyleClass(String styleClass)
          Sets the CSS style class of the ButtonControl.
 void setToolTip(String toolTip)
          Sets the toolTip of the button.
 void setType(String type)
          Sets the type of the button.
 void setValue(String value)
          Sets the text value of the button.
 void setValueExpression(String name, javax.el.ValueExpression binding)
          Sets the value binding.
 
Methods inherited from class javax.faces.component.UICommand
addActionListener, broadcast, getAction, getActionExpression, getActionListener, getActionListeners, isImmediate, queueEvent, removeActionListener, setAction, setActionExpression, setActionListener, setImmediate, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
The standard component family for this component.

See Also:
Constant Field Values

COMPONENT_TYPE

public static final String COMPONENT_TYPE
The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

ButtonControl

public ButtonControl()
Instantiates an object of ButtonControl.

Method Detail

getFamily

public String getFamily()
Returns the family of this control.

Overrides:
getFamily in class javax.faces.component.UICommand
Returns:
String- the COMPONENT_FAMILY

getMapId

public String getMapId()
Returns the map control id associated with the control.

Returns:
Returns the mapId.

setMapId

public void setMapId(String mapId)
Sets the map control id associated with the control.

Parameters:
mapId - The mapId to set.

getDefaultImage

public String getDefaultImage()
Returns the default image that is set for this control.

Returns:
Returns the defaultImage.

setDefaultImage

public void setDefaultImage(String defaultImage)
Sets the default image that is set for this control.

Parameters:
defaultImage - The defaultImage to set.

getStyleClass

public String getStyleClass()
Gets the CSS style class of the ButtonControl.

Returns:
Returns the styleClass.

setStyleClass

public void setStyleClass(String styleClass)
Sets the CSS style class of the ButtonControl.

Parameters:
styleClass - The styleClass to set.

isDisabled

public boolean isDisabled()
Returns true if the button is disabled.

Returns:
Returns the disabled.

setDisabled

public void setDisabled(boolean disabled)
Sets to true if the button is disabled.

Parameters:
disabled - The disabled to set.

getHoverImage

public String getHoverImage()
Returns the hover image that is set for this control.

Returns:
Returns the hoverImage.

setHoverImage

public void setHoverImage(String hoverImage)
Sets the hover image that is set for this control.

Parameters:
hoverImage - The hoverImage to set.

getSelectedImage

public String getSelectedImage()
Gets the selected image that is set for this control.

Returns:
Returns the selectedImage.

setSelectedImage

public void setSelectedImage(String selectedImage)
Sets the selected image that is set for this control.

Parameters:
selectedImage - The selectedImage to set.

getClientAction

public String getClientAction()
Gets the client action of the button, should be a JavaScript method.

Returns:
Returns the clientAction.

setClientAction

public void setClientAction(String clientAction)
Sets the client action of the button, should be a JavaScript method.

Parameters:
clientAction - The clientAction to set.

getServerAction

public String getServerAction()
Gets the server action of the button, should be a backing bean method.

Returns:
Returns the serverAction.

setServerAction

public void setServerAction(String serverAction)
Sets the server action of the button, should be a backing bean method.

Parameters:
serverAction - The serverAction to set.

getValue

public String getValue()
Gets the text value of the button.

Overrides:
getValue in class javax.faces.component.UICommand
Returns:
Returns the value.

setValue

public void setValue(String value)
Sets the text value of the button.

Parameters:
value - The value to set.

getType

public String getType()
Gets the type of the button.

Returns:
Returns the type.

setType

public void setType(String type)
Sets the type of the button.

Parameters:
type - The type to set.

getStyle

public String getStyle()
Gets the CSS style of the button.

Returns:
Returns the style.

setStyle

public void setStyle(String style)
Sets the CSS style of the button.

Parameters:
style - The style to set.

getToolTip

public String getToolTip()
Gets the toolTip of the button.

Returns:
Returns the toolTip.

setToolTip

public void setToolTip(String toolTip)
Sets the toolTip of the button.

Parameters:
toolTip - The toolTip to set.

getOnclick

public String getOnclick()
Gets the onclick event of the button.

Returns:
Returns the onclick.

setOnclick

public void setOnclick(String onclick)
Sets the onclick event of the button.

Parameters:
onclick - The onclick to set.

getCollectionId

public String getCollectionId()
Gets the collectionId of the ButtonControl.

Returns:
Returns the collectionId.

setCollectionId

public void setCollectionId(String collectionId)
Sets the collectionId of the ButtonControl.

Parameters:
collectionId - The collectionId to set.

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UICommand

saveState

public Object saveState(javax.faces.context.FacesContext facesContext)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UICommand

execute

public void execute(MapEvent event)
             throws Exception
Executes the server action associated with this button. It will be invoked if the button is a MapToolItem.

Specified by:
execute in interface MapToolAction
Parameters:
event - the MapEvent to execute this tool
Throws:
Exception - if an error happens while executing the tool. The MapControl aborts processing the current event when this happens.

registerMapToolItem

public void registerMapToolItem(javax.faces.context.FacesContext facesContext)
Registers the button as a MapToolItem.


execute

public void execute(javax.faces.context.FacesContext context)
Executes the server action associated with this button. It will be invoked if the button is not a MapToolItem.


setValueExpression

public void setValueExpression(String name,
                               javax.el.ValueExpression binding)
Sets the value binding. For the "value" attribute it checks if it is an instanceof TaskInfo or not. If not, it throws an ADFException. For all other cases, it simply calls super.setValueBinding()

Overrides:
setValueExpression in class javax.faces.component.UIComponent
Parameters:
name - the name of the attribute or property for which to set a ValueBinding
binding - the ValueBinding to set. If null, remove any currently set ValueBinding.