Quantcast

Dojo 1.6 Upgrade to 1.7 Difficulties

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Dojo 1.6 Upgrade to 1.7 Difficulties

carterventures
Hi there!

We're having some real issues upgrading our application to 1.7 from 1.6.  A lot of it seems to be centered around the custom Widgets we've created.  For instance, we're getting an Uncaught Reference error here:

====================================
dojo.require("dijit.form.Form");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dijit._WidgetBase");
dojo.require("dijit._TemplatedMixin");
dojo.require("dojo.parser");

dojo.declare("app.recordings.searchpane", [_WidgetBase, _TemplatedMixin], { // <-- Error here, on _WidgetBase
======================================

Here is the gist of our <head> (the app.recordings.controller requires the searchpane widget, and loads it):

============================================

 <script type="text/javascript"> var dojoConfig = { isDebug: true, debugAtAllCosts: true, async: false, parseOnLoad: true, modulePaths: { "images": "../../images", "root": "../../..", "silverlight": "../../../ClientBin", "app": "../app", "dijit": "../dijit" } } </script>
<script src="javascript/dojo/dojo.js" type="text/javascript"></script>
    <script type="text/javascript"> // load initial set of dependencies - the app controller dojo.require("app.recordings.controller"); dojo.ready(function () { // do whatever the controller considers necessary for initialization window.controller = new app.recordings.controller(); }); </script>======================================================
All of this was working in 1.6, but with the upgrade to 1.7, the requires appear to be having issues.

Thanks to anyone who could provide a little gentle prodding in the right direction :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dojo 1.6 Upgrade to 1.7 Difficulties

Kenneth G. Franqueiro
That doesn't quite look like anything I'd expect to work on 1.6 either;
namely, _WidgetBase and _TemplatedMixin would certainly not exist under
those variable names directly, but rather namespaced under dijit, e.g.
dijit._WidgetBase and dijit._TemplatedMixin.  (Of course,
_TemplatedMixin also didn't exist until 1.7, but I reckon that's beside
the point.)

As long as you're using the dojo.provide/require syntax, I'd expect the
code to continue referencing these via the dijit namespace.

However, if you were to pursue using the AMD format with Dojo 1.7, then
you could pull off something like this in a module:

define([
  "dojo/_base/declare",
  "dijit/_WidgetBase",
  "dijit/_TemplatedMixin",
  "dijit/form/Form",
  "dijit/form/Button",
  "dijit/form/CheckBox",
  "dijit/form/ValidationTextBox",
  "dojo/parser"
], function(declare, _WidgetBase, _TemplatedMixin){
  return declare([_WidgetBase, _TemplatedMixin], {
    ...
  });
});

In this case, declare, _WidgetBase, and _TemplatedMixin are available
"directly" because they are the names of arguments received by the
callback registered with this define call, which means they will receive
the return values of the respectively-requested modules.

--Ken

On 1/2/2012 7:13 PM, carterventures wrote:

> Hi there!
>
> We're having some real issues upgrading our application to 1.7 from 1.6.  A
> lot of it seems to be centered around the custom Widgets we've created.  For
> instance, we're getting an Uncaught Reference error here:
>
> ====================================
> dojo.require("dijit.form.Form");
> dojo.require("dijit.form.Button");
> dojo.require("dijit.form.CheckBox");
> dojo.require("dijit.form.ValidationTextBox");
> dojo.require("dijit._WidgetBase");
> dojo.require("dijit._TemplatedMixin");
> dojo.require("dojo.parser");
>
> dojo.declare("app.recordings.searchpane", [_WidgetBase, _TemplatedMixin], {
> // <-- Error here, on _WidgetBase
> ======================================
>
> Here is the gist of our <head> (the app.recordings.controller requires the
> searchpane widget, and loads it):
>
> ============================================
>
>  
>
>
>
>    
> ======================================================
> All of this was working in 1.6, but with the upgrade to 1.7, the requires
> appear to be having issues.
>
> Thanks to anyone who could provide a little gentle prodding in the right
> direction :)
>
> --
> View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dojo-1-6-Upgrade-to-1-7-Difficulties-tp3627895p3627895.html
> Sent from the Dojo Toolkit mailing list archive at Nabble.com.
> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
>
> [hidden email]
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dojo 1.6 Upgrade to 1.7 Difficulties

Kenneth G. Franqueiro
This should've occurred to me before I replied, but I'd also note that
if your widget uses widgets within its template (which based on your
other dependencies I'm guessing it might), you'll also want to require
dijit/_WidgetsInTemplateMixin and mix that into your widget after
_TemplatedMixin.

--Ken

On 1/2/2012 8:52 PM, Kenneth G. Franqueiro wrote:

> That doesn't quite look like anything I'd expect to work on 1.6 either;
> namely, _WidgetBase and _TemplatedMixin would certainly not exist under
> those variable names directly, but rather namespaced under dijit, e.g.
> dijit._WidgetBase and dijit._TemplatedMixin.  (Of course,
> _TemplatedMixin also didn't exist until 1.7, but I reckon that's beside
> the point.)
>
> As long as you're using the dojo.provide/require syntax, I'd expect the
> code to continue referencing these via the dijit namespace.
>
> However, if you were to pursue using the AMD format with Dojo 1.7, then
> you could pull off something like this in a module:
>
> define([
>   "dojo/_base/declare",
>   "dijit/_WidgetBase",
>   "dijit/_TemplatedMixin",
>   "dijit/form/Form",
>   "dijit/form/Button",
>   "dijit/form/CheckBox",
>   "dijit/form/ValidationTextBox",
>   "dojo/parser"
> ], function(declare, _WidgetBase, _TemplatedMixin){
>   return declare([_WidgetBase, _TemplatedMixin], {
>     ...
>   });
> });
>
> In this case, declare, _WidgetBase, and _TemplatedMixin are available
> "directly" because they are the names of arguments received by the
> callback registered with this define call, which means they will receive
> the return values of the respectively-requested modules.
>
> --Ken
>
> On 1/2/2012 7:13 PM, carterventures wrote:
>> Hi there!
>>
>> We're having some real issues upgrading our application to 1.7 from 1.6.  A
>> lot of it seems to be centered around the custom Widgets we've created.  For
>> instance, we're getting an Uncaught Reference error here:
>>
>> ====================================
>> dojo.require("dijit.form.Form");
>> dojo.require("dijit.form.Button");
>> dojo.require("dijit.form.CheckBox");
>> dojo.require("dijit.form.ValidationTextBox");
>> dojo.require("dijit._WidgetBase");
>> dojo.require("dijit._TemplatedMixin");
>> dojo.require("dojo.parser");
>>
>> dojo.declare("app.recordings.searchpane", [_WidgetBase, _TemplatedMixin], {
>> // <-- Error here, on _WidgetBase
>> ======================================
>>
>> Here is the gist of our <head> (the app.recordings.controller requires the
>> searchpane widget, and loads it):
>>
>> ============================================
>>
>>  
>>
>>
>>
>>    
>> ======================================================
>> All of this was working in 1.6, but with the upgrade to 1.7, the requires
>> appear to be having issues.
>>
>> Thanks to anyone who could provide a little gentle prodding in the right
>> direction :)
>>
>> --
>> View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dojo-1-6-Upgrade-to-1-7-Difficulties-tp3627895p3627895.html
>> Sent from the Dojo Toolkit mailing list archive at Nabble.com.
>> ________________________________________________________
>> Dojotoolkit: http://dojotoolkit.org
>> Reference Guide: http://dojotoolkit.org/reference-guide
>> API Documentation: http://dojotoolkit.org/api
>> Tutorials: http://dojotoolkit.org/documentation
>>
>> [hidden email]
>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
>
> [hidden email]
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...