It turns out that the best solution for me is to use dojox/app, as suggested by @tik27.
I was trying to extend the controller module associated to the view (see AppControllers/View1.js in the config below) but that module is simply mixed to the View. If I want to get a classy handling of the Views I can leverage the type property (see again the config json excerpt below).
config.json:
{
//...
"views":{
//...
"View1":{
"template":"AppTemplates/View1.html",
"controller":"AppControllers/View1.js"
"type":"my/SpecializedView.js"
},
//...
}
//...
}
To do this I have to simply extend dojox/app/View in my my/GenericView which will contain custom properties and methods. Then I can write SpecializedViews extending my/GenericView:
my/GenericView.js
define([
"dojo/_base/declare",
"dojox/app/View"
], function(declare, View) {
return declare("my/GenericView",[View], {
customProp: "example", // Default content
customMethod:function(){
//do something
}
});
});
my/SpecializedView.js
define([
"dojo/_base/declare",
"my/GenericView"
], function(declare, GenericView) {
return declare(GenericView, {
init:function(){
console.log(this.customProp);//will print "example"
}
customMethod:function(){
this.inherited(arguments);//recall parent class' method
//extend parent class' method
}
});
});
Anyway, the title of this question refers to dojox/mobile so you can find a fully dojox/mobile example il this jsfiddle http://jsfiddle.net/g00glen00b/5PCrb/ by @Dimitri M