|
|||||||||||
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.scripting.BScript
BScript is used to attach a javascript command to a DOM element attribute.
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 | |
static int |
APPEND
|
protected java.lang.String |
jsattr
|
protected java.lang.String |
jscmd
|
protected static org.apache.log4j.Logger |
logger
|
protected int |
mode
|
static java.lang.String |
ON_BLUR
|
static java.lang.String |
ON_CHANGE
|
static java.lang.String |
ON_CLICK
|
static java.lang.String |
ON_DBL_CLICK
|
static java.lang.String |
ON_FOCUS
|
static java.lang.String |
ON_KEY_DOWN
|
static java.lang.String |
ON_KEY_PRESS
|
static java.lang.String |
ON_KEY_UP
|
static java.lang.String |
ON_LOAD
|
static java.lang.String |
ON_MOUSE_DOWN
|
static java.lang.String |
ON_MOUSE_MOVE
|
static java.lang.String |
ON_MOUSE_OUT
|
static java.lang.String |
ON_MOUSE_OVER
|
static java.lang.String |
ON_MOUSE_UP
|
static java.lang.String |
ON_RESET
|
static java.lang.String |
ON_SELECT
|
static java.lang.String |
ON_SUBMIT
|
static java.lang.String |
ON_UNLOAD
|
static int |
PREPEND
|
static int |
REPLACE
|
protected java.util.List |
resources
|
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 | |
BScript()
Public noargs constructor |
|
BScript(java.lang.String jsattr,
java.lang.String jscmd)
Public constructor which creates the component. |
|
BScript(java.lang.String jsattr,
java.lang.String jscmd,
int mode)
Public constructor which creates the component. |
|
BScript(java.lang.String jsattr,
java.lang.String jscmd,
int mode,
java.lang.String resource)
Public constructor which creates the component. |
Method Summary | |
void |
addResource(java.lang.String resource)
Add a script resource (resources specified will automatically create BScriptResource delegates at render time) |
java.lang.String |
getAttr()
Get the JavaScript attr the command is be bound to |
java.lang.String |
getCmd()
Get the JavaScript command for this particular component |
int |
getMode()
Get the replacement mode for this script |
java.util.List |
getResources()
Get a list of script resource |
void |
removeResource(java.lang.String resource)
Remove a script resource |
void |
setAttr(java.lang.String ijsattr)
Specify the JavaScript attr the command should be bound to |
void |
setCmd(java.lang.String ijscmd)
Set the JavaScript command for this particular component |
void |
setMode(int imode)
Set the mode for the action (defaults to REPLACE). |
java.lang.String |
toString()
Get a String representation of the component |
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, 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
public static final int REPLACE
public static final int PREPEND
public static final int APPEND
public static final java.lang.String ON_CLICK
public static final java.lang.String ON_DBL_CLICK
public static final java.lang.String ON_MOUSE_DOWN
public static final java.lang.String ON_MOUSE_UP
public static final java.lang.String ON_MOUSE_OVER
public static final java.lang.String ON_MOUSE_MOVE
public static final java.lang.String ON_MOUSE_OUT
public static final java.lang.String ON_KEY_PRESS
public static final java.lang.String ON_KEY_DOWN
public static final java.lang.String ON_KEY_UP
public static final java.lang.String ON_LOAD
public static final java.lang.String ON_UNLOAD
public static final java.lang.String ON_FOCUS
public static final java.lang.String ON_BLUR
public static final java.lang.String ON_SELECT
public static final java.lang.String ON_CHANGE
public static final java.lang.String ON_SUBMIT
public static final java.lang.String ON_RESET
protected java.lang.String jscmd
protected java.lang.String jsattr
protected int mode
protected java.util.List resources
Constructor Detail |
public BScript()
public BScript(java.lang.String jsattr, java.lang.String jscmd)
You should generally only use this constructor when returning BScript from a Model, as the model components will automatically bind the component to a view for you. If you use this constructor in some other situation, you should manually bind the component to the proper view.
jsattr
- the target script attributejscmd
- the script commandpublic BScript(java.lang.String jsattr, java.lang.String jscmd, int mode)
jsattr
- the target script attributejscmd
- the script commandmode
- the cmd replacement mode (REPLACE, PREPEND, or APPEND)public BScript(java.lang.String jsattr, java.lang.String jscmd, int mode, java.lang.String resource)
jsattr
- the target script attributejscmd
- the script commandmode
- the cmd replacement mode (REPLACE, PREPEND, or APPEND)resource
- any necessary resource scriptsMethod Detail |
public void setAttr(java.lang.String ijsattr)
public java.lang.String getAttr()
public void setCmd(java.lang.String ijscmd)
public java.lang.String getCmd()
public void setMode(int imode)
public int getMode()
public void addResource(java.lang.String resource)
public void removeResource(java.lang.String resource)
public java.util.List getResources()
public java.lang.String toString()
toString
in class AbstractBComponent
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |