org.barracudamvc.core.comp
Class BScriptResource

java.lang.Object
  extended by org.barracudamvc.core.comp.AbstractBComponent
      extended by org.barracudamvc.core.comp.BComponent
          extended by org.barracudamvc.core.comp.BScriptResource
All Implemented Interfaces:
Attrs, BContainer, StateMap

public class BScriptResource
extends BComponent

BScriptResource is used to make sure a client side script is available for use by client scripting code.

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 String JS_CLIENT_SERVER_HTTP_LIB
           
static String JS_FORM_CONTROL
           
static String JS_SCRIPTING_CHECK
           
protected static org.apache.log4j.Logger logger
           
protected  String src
           
 
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
BScriptResource()
          Public noargs constructor
BScriptResource(String src)
          Public constructor which creates the component.
 
Method Summary
 String getSrc()
          Get the src for this particular component
 BScriptResource setSrc(String isrc)
          Set the src for this particular component
 String toString()
          Get a String representation of the component
 
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, getRendererFactory, getRootComponent, getState, getStateKeys, getStateStore, hasChildren, hasViews, initCycle, installRendererFactory, invalidate, isStepChild, printStackTrace, printStackTrace, printStackTrace, putState, removeAll, removeAllStepChildren, removeChild, removeChild, removeState, setAttr, setDefaultViewContext, setParent, toRef, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

JS_CLIENT_SERVER_HTTP_LIB

public static final String JS_CLIENT_SERVER_HTTP_LIB
See Also:
Constant Field Values

JS_FORM_CONTROL

public static final String JS_FORM_CONTROL
See Also:
Constant Field Values

JS_SCRIPTING_CHECK

public static final String JS_SCRIPTING_CHECK
See Also:
Constant Field Values

src

protected String src
Constructor Detail

BScriptResource

public BScriptResource()
Public noargs constructor


BScriptResource

public BScriptResource(String src)
Public constructor which creates the component. When rendered, it will make sure that the src script is available to the client.

You should generally only use this constructor when returning BScriptResource 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.

Parameters:
src - the src script that backs this component
Method Detail

setSrc

public BScriptResource setSrc(String isrc)
Set the src for this particular component

Parameters:
isrc - the src script that backs this component

getSrc

public String getSrc()
Get the src for this particular component

Returns:
the src for this particular component

toString

public String toString()
Get a String representation of the component

Overrides:
toString in class AbstractBComponent
Returns:
a String representation of the component


Copyright © 2006 BarracudaMVC.org All Rights Reserved.