Mixin: SC.ResponderContext

The root object for a responder chain. A responder context can dispatch actions directly to a first responder; walking up the responder chain until it finds a responder that can handle the action.

If no responder can be found to handle the action, it will attempt to send the action to the defaultResponder.

You can have as many ResponderContext's as you want within your application. Every SC.Pane and SC.Application automatically implements this mixin.

Note that to implement this, you should mix SC.ResponderContext into an SC.Responder or SC.Responder subclass.

Defined in: responder_context.js

Since:
SproutCore 1.0

Field Summary

Class Methods

Field Detail

SC.ResponderContext.defaultResponder SC.Responder
SC.ResponderContext.firstResponder
SC.ResponderContext.trace

Class Method Detail

makeFirstResponder(responder, evt)

Makes the passed responder into the new firstResponder for this responder context. This will cause the current first responder to lose its responder status and possibly keyResponder status as well.

When you change the first responder, this will send callbacks to responders up the chain until you reach a shared responder, at which point it will stop notifying.

Parameters:
responder SC.Responder
evt Event
that cause this to become first responder
Returns:
SC.ResponderContext
receiver
nextResponder()
nextResponderFor(responder)

Finds the next responder for the passed responder based on the responder's nextResponder property. If the property is a string, then lookup the path in the receiver.

Parameters:
responder
resetFirstResponder()
Re-enters the current responder (calling willLoseFirstResponder and didBecomeFirstResponder).
responderNameFor(responder)
Finds the responder name by searching the responders one time.
Parameters:
responder
sendAction(action, sender, context)

Send the passed action down the responder chain, starting with the current first responder. This will look for the first responder that actually implements the action method and returns YES or no value when called.

Parameters:
action String
name of action
sender Object
object sending the action
context Object Optional
additional context info
Returns:
SC.Responder
the responder that handled it or null
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:21 GMT-0600 (CST)