C# Class Castle.MonoRail.Framework.Helpers.BehaviourHelper

Exposes the functionality available on the Behaviour js library which Uses css selectors to bind javascript code to DOM elements
Before using it, you must install the scripts. See BehaviourHelper.InstallScripts
Inheritance: AbstractHelper
Show file Open project: nats/castle-1.0.3-mono

Public Methods

Method Description
AddLoadEvent ( String loadFunctionName ) : String

Renders a script block invoking Behaviour.addLoadEvent(loadFunctionName);

EndBehaviourRegister ( ) : String

Renders the end of a script block that associated events to selector rules StartBehaviourRegister Register

InstallScripts ( ) : String

Renders a script tag refering the Behaviour library code.

ReApply ( ) : String

Renders a script block invoking Behaviour.apply()

Register ( String selector, String eventName, String jsFunctionName ) : String

Adds a entry to a registration array. Invoking it with #form, onsubmit and validate will produce '#form' : function(e){ e.onsubmit = validate; }, StartBehaviourRegister EndBehaviourRegister

StartBehaviourRegister ( ) : String

Renders a script block starting the association of events to selector rules Register EndBehaviourRegister

Method Details

AddLoadEvent() public method

Renders a script block invoking Behaviour.addLoadEvent(loadFunctionName);
public AddLoadEvent ( String loadFunctionName ) : String
loadFunctionName String The name of the js function to be invoked when the body is loaded
return String

EndBehaviourRegister() public method

Renders the end of a script block that associated events to selector rules StartBehaviourRegister Register
public EndBehaviourRegister ( ) : String
return String

InstallScripts() public method

Renders a script tag refering the Behaviour library code.
public InstallScripts ( ) : String
return String

ReApply() public method

Renders a script block invoking Behaviour.apply()
public ReApply ( ) : String
return String

Register() public method

Adds a entry to a registration array. Invoking it with #form, onsubmit and validate will produce '#form' : function(e){ e.onsubmit = validate; }, StartBehaviourRegister EndBehaviourRegister
public Register ( String selector, String eventName, String jsFunctionName ) : String
selector String The css selector rule
eventName String The name of the event on the element
jsFunctionName String The function to be invoked in response to the event
return String

StartBehaviourRegister() public method

Renders a script block starting the association of events to selector rules Register EndBehaviourRegister
public StartBehaviourRegister ( ) : String
return String