Posted in October, 2008

JSON Schema in Dojo October 31st, 2008 at 7:36 am by Kris Zyp

JSON Schema is a specification for defining the structure of JSON data. JSON Schema provides the definition of contractual type constraints for describing a valid set of values for object style data structures. JSON Schema development is based on the concepts from XML Schema, RelaxNG, and Kwalify, but is a JSON-based format, so it is well suited for JSON-based applications. It is intended to provide validation, documentation, and interaction control. Defining type constraints provides a standardized form of data documentation that can be used for data persistence, form generation, and creating contracts on data used in web services.

(more…)

Automatic Dojo Builds October 28th, 2008 at 1:30 am by Jason Cline

The build system that is part of the Dojo Toolkit is an incredibly powerful tool. Making sure that your custom build is always up-to-date in your web application can be time consuming and error prone if done manually. This post will demonstrate how to quickly add custom Dojo builds into any web application that uses Apache Ant.

(more…)

Debunking Dojo Toolkit Myths October 27th, 2008 at 9:46 am by Dylan Schiemann

The Dojo Toolkit has been around for over four years, and has undergone significant changes, both big and small, in becoming a great JavaScript toolkit. This article debunks myth and outdated assumptions (both fair and false) applied to Dojo over its four plus years of development.

(more…)

Inside Dojo DnD: Drag Handles October 24th, 2008 at 12:09 am by Eugene Lazutkin

A frequently overlooked and underused feature of Dojo’s Drag-and-Drop (DnD) module is drag handles.

DnD is commonly implemented as a set of draggable elements where the entire DnD item (usually a subtree of DOM nodes) can detect the drag action. In some cases, this is not desirable:

  • DnD items that contain active elements: links, text areas, buttons, check boxes, other common form elements. The drag action can prevent normal interactions with them, e.g., text selection inside text boxes.
  • Large DnD items that occupy most of screen. Frequently these items have collapsed and expanded states, and should not be dragged while expanded.

(more…)

DOM Attributes and The Dojo Toolkit 1.2 October 23rd, 2008 at 12:01 am by Mike Wilcox

The Dojo Toolkit 1.2 has landed and I’ll be talking about a new feature — dojo.attr — and its closely related cousin, dojo.style. In a given block of HTML, not all attributes are created equally. Take the following example:

<div id="testDiv" 
	tabindex='1" 
	onmouseover="onOver();" 
	name="nameAtt" 
	style="background:#ffff00;">
New Content
</div>

(more…)

New Features in Dojo Grid 1.2 October 22nd, 2008 at 11:10 am by Bryan Forbes

The last article about the Dojo Grid focused on what has changed when creating a grid using Dojo 1.2. In this article we will be covering five new features of the Dojo 1.2 Grid: Dijit interoperability, selection modes, reorderable columns, header context menus, and column hiding. The examples in this article can be downloaded in a tarball (which includes the build profile I used) so you can play along from home!

(more…)

Quick Fixes and Dojo Support October 21st, 2008 at 7:55 am by Peter Higgins

A lot of the stock Dijit components are single-serve, meaning they only solve one style of problem. But Dojo is very flexible, and can work most any way you imagine or intend — you just have to put on your coder hat, and bend away. That’s where I come in. One of the things I do most often in my role as lead support for SitePen’s Dojo Support offering is to find simple solutions and workarounds for problems encountered when the widget code doesn’t behave exactly as you want, or otherwise needs some level of professional bending.

(more…)

Dojo: Building Blocks of the Web October 17th, 2008 at 6:07 pm by Peter Higgins

Dojo is a very flexible toolkit. Most every aspect of its functionality is extensible by taking advantage of JavaScript’s dynamic nature. Today, I’m going to show you how you can write your own modular reusable code to create a generic component you can provide others (perhaps your development team, or designers?) to use in whichever way they desire … Just like the toolkit itself.

(more…)

DWR Hooks and Dojo Dialogs October 16th, 2008 at 5:29 pm by Joe Walker

It’s common to use Dojo to talk to a Java server using DWR. Here’s a handy hint for how to add a nice “loading” feature that uses a Dojo widget to display the progress made by a DWR call.

DWR has had a useLoadingMessage() function since version 1.0, but there have always been some problems with it - it mimics the early GMail loading message, which is OK if you like that style, but not otherwise. It can get confused if there are multiple actions outstanding, and there is no way to tell it to go away if you need to continue interacting with the page. We try with DWR to focus on remoting and not widgets, so we have not spent a lot of time on a fancy loading message widget.

Enter the Dijit Dialog which can solve all of these problems in addition to being accessible, themeable, localizable and generally more full of goodness.

(more…)

Dojo Sensei Reader, a Training Application October 14th, 2008 at 12:02 am by Revin Guillen

When conducting Dojo training courses, we’ve found it to be very valuable to go beyond simple code snippets to demonstrate APIs, patterns, and other key concepts. Snippets and demos are useful, but they often lack a very important quality: context. Nothing beats having a full application in front of you—with code available to read and modify as you learn the ropes—so we built the Dojo Sensei Reader, a rich, powerful RSS reader realized as a single-page web application.

(more…)