|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 String |
jsattr
|
protected String |
jscmd
|
protected static org.apache.log4j.Logger |
logger
|
protected int |
mode
|
static String |
ON_BLUR
|
static String |
ON_CHANGE
|
static String |
ON_CLICK
|
static String |
ON_DBL_CLICK
|
static String |
ON_FOCUS
|
static String |
ON_KEY_DOWN
|
static String |
ON_KEY_PRESS
|
static String |
ON_KEY_UP
|
static String |
ON_LOAD
|
static String |
ON_MOUSE_DOWN
|
static String |
ON_MOUSE_MOVE
|
static String |
ON_MOUSE_OUT
|
static String |
ON_MOUSE_OVER
|
static String |
ON_MOUSE_UP
|
static String |
ON_RESET
|
static String |
ON_SELECT
|
static String |
ON_SUBMIT
|
static String |
ON_UNLOAD
|
static int |
PREPEND
|
static int |
REPLACE
|
protected List |
resources
|
Fields inherited from class org.enhydra.barracuda.core.comp.BComponent |
attrs, enabled, name, rs, VISIBILITY_MARKER, visible |
Fields inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent |
children, dvc, isStepChild, parent, statemap, stepChildren, tempViews, validated, views |
Constructor Summary | |
BScript()
Public noargs constructor |
|
BScript(String jsattr,
String jscmd)
Public constructor which creates the component. |
|
BScript(String jsattr,
String jscmd,
int mode)
Public constructor which creates the component. |
|
BScript(String jsattr,
String jscmd,
int mode,
String resource)
Public constructor which creates the component. |
Method Summary | |
void |
addResource(String resource)
Add a script resource (resources specified will automatically create BScriptResource delegates at render time) |
String |
getAttr()
Get the JavaScript attr the command is be bound to |
String |
getCmd()
Get the JavaScript command for this particular component |
int |
getMode()
Get the replacement mode for this script |
List |
getResources()
Get a list of script resource |
void |
removeResource(String resource)
Remove a script resource |
void |
setAttr(String ijsattr)
Specify the JavaScript attr the command should be bound to |
void |
setCmd(String ijscmd)
Set the JavaScript command for this particular component |
void |
setMode(int imode)
Set the mode for the action (defaults to REPLACE). |
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, clearState, destroyCycle, findComponentMap, findRendererFactory, getChild, getChildren, getDefaultViewContext, getParent, getRenderer, getRenderer, getRootComponent, getState, getStateKeys, getStateValues, hasChildren, hasViews, initCycle, installRendererFactory, invalidate, isStepChild, printStackTrace, printStackTrace, printStackTrace, putState, removeAll, removeAllStepChildren, removeChild, removeChild, removeState, setDefaultViewContext, setParent, toRef, 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
public static final int REPLACE
public static final int PREPEND
public static final int APPEND
public static final String ON_CLICK
public static final String ON_DBL_CLICK
public static final String ON_MOUSE_DOWN
public static final String ON_MOUSE_UP
public static final String ON_MOUSE_OVER
public static final String ON_MOUSE_MOVE
public static final String ON_MOUSE_OUT
public static final String ON_KEY_PRESS
public static final String ON_KEY_DOWN
public static final String ON_KEY_UP
public static final String ON_LOAD
public static final String ON_UNLOAD
public static final String ON_FOCUS
public static final String ON_BLUR
public static final String ON_SELECT
public static final String ON_CHANGE
public static final String ON_SUBMIT
public static final String ON_RESET
protected String jscmd
protected String jsattr
protected int mode
protected List resources
Constructor Detail |
public BScript()
public BScript(String jsattr, 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(String jsattr, String jscmd, int mode)
jsattr
- the target script attributejscmd
- the script commandmode
- the cmd replacement mode (REPLACE, PREPEND, or APPEND)public BScript(String jsattr, String jscmd, int mode, 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(String ijsattr)
ijsattr
- the JavaScript attr the command should be bound topublic String getAttr()
public void setCmd(String ijscmd)
ijscmd
- the JavaScript command that backs this componentpublic String getCmd()
public void setMode(int imode)
imode
- the cmd replacement modepublic int getMode()
public void addResource(String resource)
resource
- a script resourcepublic void removeResource(String resource)
resource
- a script resourcepublic List getResources()
public String toString()
toString
in class AbstractBComponent
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |