Application Framework Reference

Module API

passContextToParent()

The passContextToParent() method passes the current module context to the parent module until a parent is found that accepts the context.

Note: Be careful using this method because of the inherent complexity of contexts passing in both directions of the hierarchy.

Synopsis

results = passContextToParent( context )

Parameters

context

Object

Module context to pass to parent.

Return Value

Boolean

Context accepted indication:

True = An upstream parent accepted the context.

False = No upstream parent accepted the context.

Example

onTimestampSelect: function(event) {
    var em = $(event.target);
    var epoch = em.attr(this.TIMESTAMP_EPOCH_TIME_ATTRIBUTE_NAME);
    if (epoch) {
        epoch = parseInt(epoch, 10);
        var context = new Splunk.Context();
        var search = new Splunk.Search();
        var range = new Splunk.TimeRange(epoch,  epoch+1);
        search.setTimeRange(range);
        context.set("search", search);
        this.passContextToParent(context);
    } else {
        this.logger.error("cannot continue.");
    }  
    return false;
},
 

See Also

applyContext()
onContextChange()
pushContextToChildren()
Splunk.Context