| execute: function( | requestObj | ) |
|
Abstract function that must be implemented in a concrete Behavior class. The Controller will automatically fire the execute() method when triggering a Behavior.
Parameters
Example
dojo.declare("myapplication.command.toggleComponent", mojo.command.Behavior,
{
execute: function(requestObj) {
//In the UI, we have an anchor with the following markup--please note the *rel* attribute.
//<a id='component1' rel='component1Content' href='view/component1'>
//<div id='component1Content'>Lots of content goes here.</div>
var targetEl = mojo.queryFirst("#" + requestObj.callerObj.getAttribute('rel')); //CSS selector for the ID
//Now we have the reference to the content panel, so we can determine its state and toggle it accordingly.
if(targetEl.style.display == 'none') {
//Show it.
} else {
//Hide it.
}
}
});