|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.barracuda.core.comp.AbstractBComponent | +--org.enhydra.barracuda.core.comp.BComponent | +--org.enhydra.barracuda.core.comp.BList | +--org.enhydra.barracuda.core.comp.BSelect
A BSelect element is used to render a list of items, and to indicate which element(s) are selected. It is typically used to manipulate <select> elements.
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 boolean |
disableBackButton
|
protected java.util.List |
listeners
|
protected static org.apache.log4j.Logger |
logger
|
protected org.enhydra.barracuda.core.comp.BSelect.LocalModelListener |
scallback
|
protected ListSelectionModel |
selectionModel
|
protected java.lang.Integer |
viewSize
|
Fields inherited from class org.enhydra.barracuda.core.comp.BList |
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 | |
BSelect()
Public noargs constructor |
|
BSelect(ListModel imodel)
Public constructor which creates the component and associates it with a ListModel |
Method Summary | |
void |
addEventListener(ListenerFactory lf)
Add an event listener to this component. |
void |
destroyCycle()
Destroy cycle. |
boolean |
getDisableBackButton()
Get disable back button |
int |
getSelectedIndex()
Convenience method to get the selected index (if the component allows multiple selections, this will return the index of the first selected item). |
int[] |
getSelectedIndexes()
Convenience method to return an int array containing all selected indexes. |
ListSelectionModel |
getSelectionModel()
Get the selection model that backs the list |
java.lang.Integer |
getViewSize()
Get the size of the component. |
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 |
setDisableBackButton(boolean idisableBackButton)
Set disable back button (only works if your client supports Javascript) |
void |
setSelectedIndex(int i)
Convenience method to set the selected index. |
void |
setSelectionModel(ListSelectionModel imodel)
Set the selection model that backs the list. |
void |
setViewSize(java.lang.Integer iviewSize)
Set the view size of the component (heighth in rows). |
Methods inherited from class org.enhydra.barracuda.core.comp.BList |
getModel, setListData, setListData, setModel |
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, 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 |
protected static org.apache.log4j.Logger logger
protected ListSelectionModel selectionModel
protected org.enhydra.barracuda.core.comp.BSelect.LocalModelListener scallback
protected java.util.List listeners
protected java.lang.Integer viewSize
protected boolean disableBackButton
Constructor Detail |
public BSelect()
public BSelect(ListModel imodel)
Method Detail |
public void setSelectionModel(ListSelectionModel imodel)
public ListSelectionModel getSelectionModel()
public int getSelectedIndex()
public void setSelectedIndex(int i)
i
- the index to be selectedpublic int[] getSelectedIndexes()
public void setViewSize(java.lang.Integer iviewSize)
public java.lang.Integer getViewSize()
public void setDisableBackButton(boolean idisableBackButton)
public boolean getDisableBackButton()
public void addEventListener(ListenerFactory lf)
lf
- the event listener to be addedpublic void removeEventListener(ListenerFactory lf)
lf
- the event listener to be removedprotected void preRender(ViewContext vc, int depth)
preRender
in class BComponent
public void destroyCycle()
destroyCycle
in class BList
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |