What is Toluu?
Toluu is a free service for sharing the feeds you read and discovering new ones.
Get Invite

SitePen Blog

SitePen Services and notes about Dojo, DWR, Cometd, JavaScript, and the Web


More Query and Caching Power for Data Stores: ClientFilter, JsonQuery, and JsonQueryRestStoreDecember 18 2008

Dojo includes several new modules which open up new querying and caching capabilities for Dojo data stores. dojox.data.ClientFilter is available in Dojo 1.2, and provides the ability to cache queries, update the query results and cached queries based on local modifications, and performs sub-queries and sorting on the client-side. The JsonQuery is a new mixin class for Dojo 1.3 that converts Dojo query objects and sort objects to JSONQuery expressions; JSONQuery can be used for delivering complex queries to the server. JsonQueryRestStore is a new module (for Dojo 1.3) that extends the JsonRestStore and combines the ClientFilter and JSONQuery such that any query can be executed on the client or the server automatically based on what data has been locally cached on the client-side, utilizing dojox.json.query to execute queries on the client-side when appropriate.

ClientFilter

ClientFilter is a base class that can be extended by other stores, to add client-side querying and sorting functionality. ClientFilter uses these capabilities for two e

End of the Year Dojo News and UpdatesDecember 17 2008

As 2008 wraps up, there are a number of announcements and noteworthy items surrounding Dojo, DWR, Persevere, and SitePen services.

Dojo News

Dojo was recently updated to version 1.2.3. Version 1.3, originally slated for this month with support for IE 8, has been postponed until January or February due to delays for the release of IE 8. Significant improvements to the quality and presentation of Dojo’s documentation are also nearing completion.

A few interesting Dojo articles were recently published including the Opera Dojo Tutorial by SitePen’s Peter Higgins. Dojo contributor Ben Hockey also created a great list of the 10 things you should know about Dojo.

Dojo co-creator Alex Russell announced Census 2, a project to more accurately compare performance between Ajax and Flex apps.

The DojoX Grid that was new to Dojo 1.2 is an extremely popular Dojo feature. Dojo contributor Peter Svensson just released a book, Learning Dojo, that is the first of its kind to effectively introduce usage of the dojo grid.

Sizzle, John Resig’s new CSS Selector engin

Taking a Look at CSS3December 9 2008

The design and styling elements that make up the Web 2.0 mantra have been defined by—among other things—rounded corners, transparency, and drop shadows. These three concepts have been key in many CSS-driven web applications or sites. (For examples of some great CSS-driven work, check out cssvault and cssBeauty.) Following the CSS2 recommendation, for years we’ve been using a combination of code and images to make these types of things possible.

My colleague, Torrey Rice, has touched upon unofficial CSS advancements in Safari 3.1 in his discussion about CSS animations, so I’ll focus on advancements that are part of ongoing CSS3 drafts. While CSS 3 as a whole is much maligned, we can use some of the properties that have already been implemented in today’s browsers with just a few simple lines of CSS. Dijit Themes for the Dojo Tooolkit already take advantage of these enhancements where it makes sense. Of course, you can also customize or write your own theme taking advantage of CSS3 wherever possible.

DojoX FileUploader Upgrade to Support Flash 10December 1 2008

I’ve just completed the upgrade of the DojoX FileUploader to make it compatible with Flash Player 10. The FileUploader widget allows for the uploading of more than one file at a time, which is surprisingly still not supported natively by any web browser on the market today.

In Flash versions 8 and 9, a file upload Browse Dialog could be launched using JavaScript code. Users could click an HTML button, which would call a JavaScript function behind the scenes, communicate with a Flash (SWF) file, which would then trigger the browse() method in the SWF. The latest Flash Player has a security feature where the user must click within a Flash-based portion of the user interface to launch the Browse Dialog. This change is to prevent malicious code from continually opening the dialog without user interaction. Working toward this upgrade was a major undertaking that involved a significant rewrite of FileUploader. The results are a success, and in addition to working with the tightened security policies, it was a great opportunity to add many new features:

  • Degradable
  • CDN Support (see below for cross-domain restriction details)
  • POST Data Support
  • Custom Field Name Support
  • Full Event Support
  • Exposed CSS Positioning
  • Dialog Container Detection

Degradable

As it worked before, the FileUploader detects if the br

Effective use of JsonRestStore: Referencing, Lazy Loading, and moreNovember 21 2008

The JsonRestStore is a Dojo Data store that provides a JSON-based RESTful interface to servers and implements the Dojo Data read, write, notification, and identity APIs.

One of the core concepts of a REST architecture is hyperlinking, and this is available in the JsonRestStore through it’s referencing support. This concept enables powerful features like lazy loading and cross-store referencing that greatly improve the effectiveness and usability of the JsonRestStore. All of the features described in this article are available with Dojo Toolkit version 1.2 and later.

Lazy Loading

The JsonRestStore utilizes JSON referencing, which is essentially hyperlinking for JSON and enables the communication of a variety of rich data structures. It also enables lazy loading, achieved by using a reference (a JSON hyperlink) to another object instead of actually including that object in the JSON structure. We can perform laz