org.barracudamvc.core.comp
Class BToggleButton
java.lang.Object
org.barracudamvc.core.comp.AbstractBComponent
org.barracudamvc.core.comp.BComponent
org.barracudamvc.core.comp.BInput
org.barracudamvc.core.comp.BToggleButton
- All Implemented Interfaces:
- Attrs, 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.barracudamvc.core.comp.BInput |
baction, BUTTON, CHECKBOX, disableBackButton, FILE, HIDDEN, IMAGE, listeners, PASSWORD, RADIO, RESET, SUBMIT, TEXT, type, value |
Methods inherited from class org.barracudamvc.core.comp.BComponent |
addView, decodeStr, encodeStr, getEncoding, getFirstView, getName, getRenderStrategy, getViews, isEnabled, isVisible, postRender, removeAllViews, removeView, render, render, renderView, renderView, setEnabled, setEnabled, setEncoding, setName, setRenderStrategy, setView, setVisible, setVisible, supports |
Methods inherited from class org.barracudamvc.core.comp.AbstractBComponent |
addChild, addStepChild, addStepChild, addTempView, clearState, destroyCycle, findComponentMap, findRendererFactory, getAttr, getAttrMap, getChild, getChildren, getDefaultViewContext, getParent, getRenderer, getRenderer, getRootComponent, getState, getStateKeys, getStateStore, hasChildren, hasViews, initCycle, installRendererFactory, invalidate, isStepChild, printStackTrace, printStackTrace, printStackTrace, putState, removeAll, removeAllStepChildren, removeChild, removeChild, removeState, setAttr, setDefaultViewContext, setParent, toRef, toString, toString, validate |
logger
protected static final org.apache.log4j.Logger logger
selected
protected boolean selected
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
setType
public BInput 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 BToggleButton 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 © 2004 BarracudaMVC.org All Rights Reserved.