org.enhydra.barracuda.core.comp
Class BInput

java.lang.Object
  |
  +--org.enhydra.barracuda.core.comp.AbstractBComponent
        |
        +--org.enhydra.barracuda.core.comp.BComponent
              |
              +--org.enhydra.barracuda.core.comp.BInput
All Implemented Interfaces:
BContainer, StateMap
Direct Known Subclasses:
BToggleButton

public class BInput
extends BComponent

BInput is used to manipulate the <input> element 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
static java.lang.String BUTTON
           
static java.lang.String CHECKBOX
           
protected  boolean disableBackButton
           
static java.lang.String FILE
           
static java.lang.String HIDDEN
           
static java.lang.String IMAGE
           
protected  java.util.List listeners
           
protected static org.apache.log4j.Logger logger
           
static java.lang.String PASSWORD
           
static java.lang.String RADIO
           
static java.lang.String RESET
           
static java.lang.String SUBMIT
           
static java.lang.String TEXT
           
protected  java.lang.String type
           
protected  java.lang.String value
           
 
Fields inherited from class org.enhydra.barracuda.core.comp.BComponent
attrs, CACHING_MARKER, enabled, name, rs, VISIBILITY_MARKER, visible
 
Fields inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent
children, dvc, isStepChild, parent, preventCaching, statemap, stepChildren, tempViews, validated, views
 
Constructor Summary
BInput()
          Public noargs constructor
BInput(java.lang.String itype, java.lang.String iname, java.lang.String ivalue)
          Public constructor which creates the component and sets the initial data.
 
Method Summary
 void addEventListener(ListenerFactory lf)
          Add an event listener to this component.
 void addEventListener(ListenerFactory lf, boolean idisableBackButton)
          Add an event listener to this component.
 java.lang.String getType()
          Get the type of input.
 java.lang.String getValue()
          Get the value for this input.
protected  void preRender(ViewContext vc, int depth)
          Here in the pre-render phase we actually add BAction step children for any of the listeners that might have been added to this component
 void removeEventListener(ListenerFactory lf)
          Remove an event listener from this component
 void setType(java.lang.String itype)
          Set the input type (TEXT, PASSWORD, SUBMIT, RESET, FILE, HIDDEN, IMAGE, BUTTON, RADIO, or CHECKBOX).
 void setValue(java.lang.String ivalue)
          Set the value for this input.
 
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, destroyCycle, findComponentMap, findRendererFactory, getChild, getChildren, getDefaultViewContext, getParent, getPreventCaching, getRenderer, getRenderer, getRootComponent, getState, getStateKeys, getStateValues, hasChildren, hasViews, initCycle, installRendererFactory, invalidate, isStepChild, printStackTrace, printStackTrace, printStackTrace, putState, removeAll, removeAllStepChildren, removeChild, removeChild, removeState, setDefaultViewContext, setParent, setPreventCaching, 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 org.apache.log4j.Logger logger

TEXT

public static final java.lang.String TEXT
See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
See Also:
Constant Field Values

SUBMIT

public static final java.lang.String SUBMIT
See Also:
Constant Field Values

RESET

public static final java.lang.String RESET
See Also:
Constant Field Values

FILE

public static final java.lang.String FILE
See Also:
Constant Field Values

HIDDEN

public static final java.lang.String HIDDEN
See Also:
Constant Field Values

IMAGE

public static final java.lang.String IMAGE
See Also:
Constant Field Values

BUTTON

public static final java.lang.String BUTTON
See Also:
Constant Field Values

RADIO

public static final java.lang.String RADIO
See Also:
Constant Field Values

CHECKBOX

public static final java.lang.String CHECKBOX
See Also:
Constant Field Values

listeners

protected java.util.List listeners

type

protected java.lang.String type

value

protected java.lang.String value

disableBackButton

protected boolean disableBackButton
Constructor Detail

BInput

public BInput()
Public noargs constructor


BInput

public BInput(java.lang.String itype,
              java.lang.String iname,
              java.lang.String ivalue)
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

Method Detail

setType

public void setType(java.lang.String itype)
Set the input type (TEXT, PASSWORD, SUBMIT, RESET, FILE, HIDDEN, IMAGE, BUTTON, 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.


getType

public java.lang.String getType()
Get the type of input. May return a null if the type has not been manually specified.

Returns:
the component type

setValue

public void setValue(java.lang.String ivalue)
Set the value for this input. In most cases, the value object will simply be rendered as the 'value' attribute. 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.


getValue

public java.lang.String getValue()
Get the value for this input. May return a null if the type has not been manually specified.

Returns:
the value for this input

addEventListener

public void addEventListener(ListenerFactory lf)
Add an event listener to this component.

Parameters:
lf - the event listener to be added

addEventListener

public void addEventListener(ListenerFactory lf,
                             boolean idisableBackButton)
Add an event listener to this component.

Parameters:
lf - the event listener to be added

removeEventListener

public void removeEventListener(ListenerFactory lf)
Remove an event listener from this component

Parameters:
lf - the event listener to be removed

preRender

protected void preRender(ViewContext vc,
                         int depth)
Here in the pre-render phase we actually add BAction step children for any of the listeners that might have been added to this component

Overrides:
preRender in class BComponent


Copyright © 2001 Enhydra.org