Archive for August, 2008
Gears might now gain some traction, with the people I try to persuade into using it, as it’s install base grows.
Components
There are several major API components to Gears:
- A Database module (powered by SQLite) that stores the data offline.[3]
- A WorkerPool module that provides parallel execution of JavaScript code.[4]
- A LocalServer module that caches and serves application resources (HTML, JavaScript, images, etc).[5]
- A Desktop module that lets web applications interact more naturally with the desktop.[6]
- A Geolocation module that lets web applications detect the geographical location of their users. [7]
In case you don’t know, CSS expressions were actual bits of JavaScript that you could run from CSS rules; this was commonly used to simulate the CSS max-width property for IE:
-
-
div.someClass {
-
/* Internet Explorer */
-
width: expression(document.body.clientWidth> 600) ? "600px" : "auto";
-
/* Standards-compliant browsers */
-
max-width: 600px;
-
}
When connecting events to simple DOM elements you use standard w3c event handlers. Here is a list of the DOM events implemented in gecko based browsers.
example 1:
1: dojo.connect(dojo.byId('htmlElement'), ‘onclick’, myFunction);
example 2:
1: dojo.connect(dojo.byId('htmlElement'),'onclick',function(){
2: dijit.byId('myDigit').show();
3: });
Doing the same thing with Dijits you need to use the available methods..they have the same name but are in camel case.
onClick
onBlur
onChance
Here is a link to the dijit.form.Button for example: dijit.form.Button
example:
1: dojo.connect(dijit.byId('myDijit'), 'onClick', doSomething);
Ok, so yesterday I spent a good deal of the day trying to figure out how to manage the display of DOM elements. I searched Google, the dojo forums, the tests on archive.dojotoolkit.org with no simple answer. Coming from a heavy jQuery background I just could not believe that you had to bring in additional classes and/or write your own functions.
But dojo is a powerful beast, sometimes referred to as an elephant, so I guess I just have to “use the force…er um…power”
Desired Functions
dojo.query(’#hide’).hide();
dojo.query(.’show’).show();
dojo.query(’.toggle’).toggle();
WARNING: The code below is incredibly crude, it does not take into account for inline elements, there are no advanced arguments like fade or animation, and the toggle method is not fully implemented.
1: dojo.extend(dojo.NodeList, {
2: show: function(){
3: console.log(this);
4: this.forEach( item.style.display = 'block' );
5: return this;
6: },
7: hide: function(){
8: this.forEach(function(item){
9: console.log(item);
10: item.style.display = 'none';
11: });
12: return this;
13: },
14: toggle: function(){
15: this.forEach(function(item){
16: if(item.style.display == 'none'){
17: //this.show();
18: item.style.display = 'block';
19: } else {
20: item.style.display = 'none';
21: }
22: });
23: return this;
24: }
25: });
PS: thanks Jayant for giving me the put to use the true power of dojo.
In jQuery DOM manipulation is incredibly easy:
$("#dealer-toggle").toggle();
One would assume the same can be accomplished in dojo via:
dojo.query('node').toggle();
but you would be DAMN WRONG!
dojo.query will work fine but hide/show/toggle have been moved to the dojo.fx and renamed fadeOut for .hide() and wipeIn for .show()…what about toggle? no sir. There is no dojo function to toggle nods. You have to write your own.
ESRI
For anyone using the ESRI JavaScript Library for ArcGIS Server (a JavaScript Lib based on Dojo): ESRI created their own namespace in the API.
The ESRI namespace consists of 7 methods. I bet you can guess 3 of them.
hide
show
and of course
toggle
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/namespace_esri.htm
Wish
- Dojo “fixes” their query interface by using common function names. even if they are alias.
- Dojo adds toggle to the functions that can be acted on node lists (a node list if what is returned from dojo.query)
- The ESRI namespace used the same constructors as Dojo. ie: hide should be dojo.query(‘node’).hide();
I’ve come to be unhappy with the jquery plugin system. I seem to be in a perpetual cycle of “lookup-download-install-initialized-use” and based on the recent milestone slippage I just don’t have the time required when the only payoff (vs. other JS libs) seems to be streamlined JavaScript package……then again aren’t all the plugins adding crazy overhead? Whatever…I’m going to use the dojotoolkit.
I love me some dojo!
After publishing a service if you make changes to the .MXD you need to clear the REST cache. There are a few ways to clear the REST cache:
- Restart IIS – Super Easy
- From the ArcGIS 9.3 REST admin page
- The Admin page is located at: http://xxxxxxxxxx/ArcGIS/rest/admin/
Until you restart IIS the updates to the MXD will not be reflected in the REST service endpoint.


August 7th 2008 Kevin passed from a heart related issue.
Viewing:
Tuesday August 12
5-7pm - ceremony @ 7:30
Donelson-Johns and Evans Funeral Home
5391 Highland Rd
Waterford, MI 48327
(248) 673-1213
Benefit:
This weekend I will be organizing a benefit event for the wade family in honor of Kevin M. Wade. There will be a poker tournament and games, a raffle and food (hamburgers, hotdog’s and other BBQ type dishes).
Date: 8/17/2008
Time: 3pm
Location: 4509 Sunflower Circle Clarkston Mi 48346
Contact: 248-462-1929
Eats: BBQ and related dishes. If anyone is so inclined please feel free to bring a dish. ( burgers and dogs are 1$ ea. with cash going to family )
Raffle: 50/50, Sports Memorabilia including pistons, tigers and wings. Again, if anyone is so inclined please feel free to bring items to raffle.
Poker Tournament: 4pm, 50$, Prizes based on # of players. 50% of prize pool goes to family.
Poker Game: We have chips, cards and its a benefit for Kevin…there will be a cash game in the evening. The rake will go to the family.
Donations:
We will be accepting donations throughout the event! We will have a donation box setup all day. Feel free to drop a few bucks in the box.
Lastly, If anyone can’t make the event and would still like to donation PLEASE contact me for info.
LINQ requires all tables that you work with to have a PK. If you don’t have a PK on a table you can use the designer to set a PK on the generated code. This won’t effect your database.
- In Visual Studio open the LINQ Designer.
- Select a row you would like as your PK and select properties.
- Update the “Primary Key” Property.
Don’t seem to play nice.
It seems that both call create a function called … Number.function and error out when used together.
Error:
[Exception... "'Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0×8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no]
Solution:
Don’t use ASP.NET AJAX if your using the vastly superior Dojo Toolkit