org.barracudamvc.core.comp
Class BList

java.lang.Object
  extended by org.barracudamvc.core.comp.AbstractBComponent
      extended by org.barracudamvc.core.comp.BComponent
          extended by org.barracudamvc.core.comp.BList
All Implemented Interfaces:
Attrs, BCompoundComponent, BContainer, StateMap
Direct Known Subclasses:
BSelect

public class BList
extends BComponent
implements BCompoundComponent

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.barracudamvc.core.comp.BComponent
DEFAULT_ENCODING, enabled, enc, name, rs, VISIBILITY_MARKER, visible
 
Fields inherited from class org.barracudamvc.core.comp.AbstractBComponent
attrs, children, dvc, isStepChild, parent, 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
 BList setListData(Iterator it)
          A convenience method that constructs a ListModel from an Iterator and then applies setModel to it.
 BList setListData(Object[] list)
          A convenience method that constructs a ListModel from an array of Objects and then applies setModel to it.
 BList setModel(ListModel imodel)
          Set the model that backs the list.
 
Methods inherited from class org.barracudamvc.core.comp.BComponent
addView, decodeStr, encodeStr, getEncoding, getFirstView, getName, getRenderStrategy, getViews, isEnabled, isVisible, postRender, preRender, 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, findComponentMap, findRendererFactory, getAttr, getAttrMap, getChild, getChildren, getDefaultViewContext, getParent, getRenderer, getRenderer, getRendererFactory, 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
 
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

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

Parameters:
imodel - the specific model to back this component
Method Detail

setModel

public BList 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.

Parameters:
imodel - the model that backs the list

getModel

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

Returns:
the model that backs the list

setListData

public BList setListData(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 BList setListData(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 © 2006 BarracudaMVC.org All Rights Reserved.