|
|||||||||||
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.BAction
A BAction component is a component that you can use to catch client side events. It can be used to render <a>, <form>, <button>, <input>, and <select> elements. It allow you to specify a specific action to be generated, or can simply default to what's in the template markup. You can also add event listeners directly to the component, and only those particular listeners will be notified when the event actually occurs on the client.
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 ControlEvent |
actionEvent
|
protected java.lang.String |
actionUrl
|
protected boolean |
disableBackButton
|
protected java.util.List |
listeners
|
protected static org.apache.log4j.Logger |
logger
|
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 | |
BAction()
Public noargs constructor |
|
BAction(ControlEvent actionEvent)
Public constructor which creates the component and binds it to a view. |
|
BAction(java.lang.String actionUrl)
Public constructor which creates the component and binds it to a view. |
Method Summary | |
void |
addEventListener(ListenerFactory lf)
Add an event listener to this component. |
java.lang.String |
getAction(ViewContext vc)
Get the action to be fired by this component. |
java.lang.String |
getAction(ViewContext vc,
boolean preventRewriting)
Get the action to be fired by this component. |
boolean |
getDisableBackButton()
Get disable back button |
java.util.Map |
getParams()
Get any associated params |
void |
removeEventListener(ListenerFactory lf)
Remove an event listener from this component |
void |
setAction(ControlEvent iactionEvent)
Set the action to be fired by this component. |
void |
setAction(java.lang.String iactionUrl)
Set the action to be fired by this component. |
void |
setDisableBackButton(boolean idisableBackButton)
Set disable back button (only works if your client supports Javascript) |
void |
setParam(java.lang.String key,
java.lang.String val)
Set any associated params |
void |
setParam(java.lang.String key,
java.lang.String[] val)
Set any associated list of params |
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, 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 |
protected static org.apache.log4j.Logger logger
protected ControlEvent actionEvent
protected java.lang.String actionUrl
protected java.util.List listeners
protected boolean disableBackButton
Constructor Detail |
public BAction()
public BAction(java.lang.String actionUrl)
actionUrl
- the action url to be firedpublic BAction(ControlEvent actionEvent)
actionEvent
- the action event to be firedMethod Detail |
public void setAction(java.lang.String iactionUrl)
public void setAction(ControlEvent iactionEvent)
public java.lang.String getAction(ViewContext vc)
vc
- the ViewContext that determines the context of the action
public java.lang.String getAction(ViewContext vc, boolean preventRewriting)
vc
- the ViewContext that determines the context of the actionpreventRewriting
- this should be set to true only if you want to
prevent URLRewriting from taking place. As a developer, you
will probably never need to do this, unless to need to further
modify the action prior to finally encoding it (HTMLActionRenderer
does this)
public void setParam(java.lang.String key, java.lang.String val)
public void setParam(java.lang.String key, java.lang.String[] val)
public java.util.Map getParams()
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 removed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |