|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.core.comp.AbstractBComponent
org.barracudamvc.core.comp.BComponent
org.barracudamvc.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 String |
actionUrl
|
protected boolean |
disableBackButton
|
protected boolean |
disableFormLocking
|
protected List |
listeners
|
protected static org.apache.log4j.Logger |
logger
|
protected Map |
params
|
protected Collection |
scriptFunctions
|
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 | |
BAction()
Public noargs constructor |
|
BAction(ControlEvent iactionEvent)
Public constructor which creates the component and binds it to a view. |
|
BAction(String iactionUrl)
Public constructor which creates the component and binds it to a view. |
Method Summary | |
BAction |
addEventListener(ListenerFactory lf)
Add an event listener to this component. |
BAction |
addScriptFunction(String functionName)
stores a Set of client-side script functions for use by the HTMLActionRenderer
. |
String |
getAction(ViewContext vc)
Get the action to be fired by this component. |
String |
getAction(ViewContext vc,
boolean preventRewriting)
Get the action to be fired by this component. |
boolean |
getDisableBackButton()
Deprecated. csc_033005_1 - this functionality does not work in Firefox or Mozilla, due to the fact that those browsers ALWAYS add an item to the browser history when a form is submitted, even if that post occurs in an IFRAME. This still does work in IE. |
boolean |
getDisableFormLocking()
Get disable form locking |
Map |
getParams()
Get any associated params |
Collection |
getScriptFunctions()
provides access any custom script functions added to a BAction component |
boolean |
hasAction()
Check for an existing action |
BAction |
removeEventListener(ListenerFactory lf)
Remove an event listener from this component |
BAction |
setAction(ControlEvent iactionEvent)
Set the action to be fired by this component. |
BAction |
setAction(String iactionUrl)
Set the action to be fired by this component. |
BAction |
setDisableBackButton(boolean idisableBackButton)
Deprecated. csc_033005_1 - this functionality does not work in Firefox or Mozilla, due to the fact that those browsers ALWAYS add an item to the browser history when a form is submitted, even if that post occurs in an IFRAME. This still does work in IE. |
BAction |
setDisableFormLocking(boolean idisableFormLocking)
Set disable form locking |
BAction |
setParam(String key,
String val)
Set any associated params |
BAction |
setParam(String key,
String[] val)
Set any associated list of params |
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, destroyCycle, findComponentMap, findRendererFactory, getAttr, getAttrMap, getChild, getChildren, getDefaultViewContext, getParent, getRenderer, getRenderer, 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 |
protected static final org.apache.log4j.Logger logger
protected ControlEvent actionEvent
protected String actionUrl
protected List listeners
protected Map params
protected Collection scriptFunctions
protected boolean disableBackButton
protected boolean disableFormLocking
Constructor Detail |
public BAction()
public BAction(String iactionUrl)
iactionUrl
- the action url to be firedpublic BAction(ControlEvent iactionEvent)
iactionEvent
- the action event to be firedMethod Detail |
public BAction setAction(String iactionUrl)
iactionUrl
- the URL representing the action to be firedpublic BAction setAction(ControlEvent iactionEvent)
iactionEvent
- the event to be fired by this componentpublic boolean hasAction()
public String getAction(ViewContext vc)
vc
- the ViewContext that determines the context of the action
public 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 BAction setParam(String key, String val)
public BAction setParam(String key, String[] val)
public Map getParams()
public BAction addScriptFunction(String functionName)
HTMLActionRenderer
. These script functions are javascript function names. The
constraints for these functions is that they take a form element as an
argument (or no arguments) and that it returns a boolean. These
functions are called in the order given and can be used for custom
client-side form validation.
functionName
- the name of the javascript function with no
parenthasispublic Collection getScriptFunctions()
addScriptFunction(String)
public BAction setDisableBackButton(boolean idisableBackButton)
idisableBackButton
- true if we want the back button disabledpublic boolean getDisableBackButton()
public BAction setDisableFormLocking(boolean idisableFormLocking)
idisableFormLocking
- true to disable locking the form elements during submit.public boolean getDisableFormLocking()
public BAction addEventListener(ListenerFactory lf)
lf
- the event listener to be addedpublic BAction 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 |