Hi,
I'm having some troubles developing my custom module. In particular I cannot pass data from the ModuleHandler to the Mako template .
Here's my code :
1. CustomModule.py
class CustomModule(module.ModuleHandler):
def generateResults(self, hostApp=None, clientApp=None, savedSearchName=None):
list = ['A','B','C','D','E']
dict = {'list':list}
return self.controller.render_template('CustomModule.html', dict)
2. CustomModule.js
Splunk.Module.CustomModule= $.klass(Splunk.Module, {
initialize: function($super, container) {
$super(container);
this.myParam = this.getParam("myParam");
this.resultsContainer = this.container;
},
onContextChange:function($super) {
this.getResults();
}
})
3. CustomModule.html
%if (list):
<label> Data passed into mako </label>
% else:
<p>Nothing</p>
% endif
4 CustomModule.conf
[module]
className = Splunk.Module.CustomModule
superClass = Splunk.Module
description = Description
The current behaviour is that the module UI displays "Nothing" . It is like the generateResults function from the CustomModule.py is not ever called.
Any hint on what I'm doing wrong or what I still need to do in order to pass a variable into the mako template would be greatly apreciated .
... View more