org.enhydra.barracuda.core.comp
Class BList

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

public class BList
extends BComponent

A BList component is used to render list data into a DOM template. It can be bound to a wide range of markup elements (see HTMLListRenderer for details).

In the case of BList, you will ALMOST ALWAYS need to manually bind it to a View, unless you happen to be returning it from a model (in which case this will be done for you automatically by cloning the node which contained the directive)


Field Summary
protected static org.apache.log4j.Logger logger
           
protected  ListModel model
           
 
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
BList()
          Public noargs constructor
BList(ListModel imodel)
          Public constructor which creates the component and binds it to a specific view
 
Method Summary
 void destroyCycle()
          Destroy cycle.
 ListModel getModel()
          Get the model that backs the list
 void setListData(java.util.Iterator it)
          A convenience method that constructs a ListModel from an Iterator and then applies setModel to it.
 void setListData(java.lang.Object[] list)
          A convenience method that constructs a ListModel from an array of Objects and then applies setModel to it.
 void setModel(ListModel imodel)
          Set the model that backs the list.
 
Methods inherited from class org.enhydra.barracuda.core.comp.BComponent
addView, getAttr, getAttrMap, getFirstView, getName, getRenderStrategy, getViews, isEnabled, isVisible, postRender, preRender, 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, 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

model

protected ListModel model
Constructor Detail

BList

public BList()
Public noargs constructor


BList

public BList(ListModel imodel)
Public constructor which creates the component and binds it to a specific view

Method Detail

setModel

public void setModel(ListModel imodel)
Set the model that backs the list. This causes the list to register as a listener on the model, so any changes to it will be reflected in the list.


getModel

public ListModel getModel()
Get the model that backs the list

Returns:
the model that backs the list

setListData

public void setListData(java.lang.Object[] list)
A convenience method that constructs a ListModel from an array of Objects and then applies setModel to it.

Parameters:
list - an array of Objects containing the items to display in the list

setListData

public void setListData(java.util.Iterator it)
A convenience method that constructs a ListModel from an Iterator and then applies setModel to it.

Parameters:
it - an iterator of objects to display in the list

destroyCycle

public void destroyCycle()
Destroy cycle. The component should use this cycle to perform any special cleanup.

Overrides:
destroyCycle in class AbstractBComponent


Copyright © 2001 Enhydra.org