org.enhydra.barracuda.core.comp
Class BToggleButton

java.lang.Object
  extended byorg.enhydra.barracuda.core.comp.AbstractBComponent
      extended byorg.enhydra.barracuda.core.comp.BComponent
          extended byorg.enhydra.barracuda.core.comp.BInput
              extended byorg.enhydra.barracuda.core.comp.BToggleButton
All Implemented Interfaces:
BContainer, StateMap

public class BToggleButton
extends BInput

BToggleButton is used to render Radio or Checkbox buttons in a DOM template.

In most cases you will not actually need to bind the component to a view in order to use it--if you return it from a model, this will be done for you automatically. If however, you intend to use the component standalone (ie. manually attaching it to a specific node in the DOM) or inline (ie. in a toString()), then you MUST BIND IT TO A VIEW before rendering, or an error will be generated.


Field Summary
protected static org.apache.log4j.Logger logger
           
protected  boolean selected
           
 
Fields inherited from class org.enhydra.barracuda.core.comp.BInput
baction, BUTTON, CHECKBOX, disableBackButton, FILE, HIDDEN, IMAGE, listeners, PASSWORD, RADIO, RESET, SUBMIT, TEXT, type, value
 
Fields inherited from class org.enhydra.barracuda.core.comp.BComponent
attrs, enabled, name, rs, VISIBILITY_MARKER, visible
 
Fields inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent
children, dvc, isStepChild, parent, statemap, stepChildren, tempViews, validated, views
 
Constructor Summary
BToggleButton()
          Public noargs constructor
BToggleButton(String itype, String iname, String ivalue, boolean iselected)
          Public constructor which creates the component and sets the initial data.
 
Method Summary
 boolean isSelected()
          Return true if the button is selected.
 void setSelected(boolean iselected)
          Specify whether or not the button is selected.
 void setType(String itype)
          Set the input type (RADIO, or CHECKBOX).
 
Methods inherited from class org.enhydra.barracuda.core.comp.BInput
addEventListener, addEventListener, getAction, getType, getValue, preRender, removeEventListener, setAction, setValue, setValue
 
Methods inherited from class org.enhydra.barracuda.core.comp.BComponent
addView, getAttr, getAttrMap, getFirstView, getName, getRenderStrategy, getViews, isEnabled, isVisible, postRender, removeAllViews, removeView, render, render, renderView, renderView, setAttr, setEnabled, setEnabled, setName, setRenderStrategy, setView, setVisible, setVisible, supports
 
Methods inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent
addChild, addStepChild, addStepChild, addTempView, clearState, destroyCycle, findComponentMap, findRendererFactory, getChild, getChildren, getDefaultViewContext, getParent, getRenderer, getRenderer, getRootComponent, getState, getStateKeys, getStateValues, hasChildren, hasViews, initCycle, installRendererFactory, invalidate, isStepChild, printStackTrace, printStackTrace, printStackTrace, putState, removeAll, removeAllStepChildren, removeChild, removeChild, removeState, setDefaultViewContext, setParent, toRef, toString, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

selected

protected boolean selected
Constructor Detail

BToggleButton

public BToggleButton()
Public noargs constructor


BToggleButton

public BToggleButton(String itype,
                     String iname,
                     String ivalue,
                     boolean iselected)
Public constructor which creates the component and sets the initial data.

Null values may be passed in for any parameters, but if you do so you will need manually provide these values (via the accessor methods) prior to actually rendering the component

Parameters:
itype - BInput.RADIO, BInput.CHECKBOX, or null (indicating don't render this attribute)
iname - the name of the button, or null (indicating don't render this attribute)
ivalue - the value of the button, or null (indicating don't render this attribute)
iselected - true if the button should be selected
Method Detail

setType

public void setType(String itype)
Set the input type (RADIO, or CHECKBOX). If this value remains null, the type will default to whatever is specified in the underlying markup. If you set this value, then the type will be overridden in all the views associated with this component.

Overrides:
setType in class BInput
Parameters:
itype - an string value representing the size.

setSelected

public void setSelected(boolean iselected)
Specify whether or not the button is selected.

Parameters:
iselected - true if the button is selected

isSelected

public boolean isSelected()
Return true if the button is selected.

Returns:
true if the button is selected.


Copyright © 2003 BarracudaMVC.org All Rights Reserved.