Hello Dojomino - custom build

6 requests, 697KB, 551ms

While the total size is much larger (280K), the number of requests is reduced to 6, many of which are in parallel rather than sequential as in the previous example, which results in significantly faster overall responsiveness.

If this page were further enhanced to use gzip compression of the resources (available in the database), the page size would be reduced to approximately 180K. Serving up Dojomino with gzip compression will be the subject of a future blog article.

This is the exact same example as Hello Dojo, but instead of loading dojo.js and letting all the other resources load sequentially as needed, this page uses a custom build called dojomino.js that includes all the widgets in the Dojomino library and its dependencies, and then loads the Dojomino DatePicker instead of the default Dijit from Dojo. This is visually obvious from the addition of the calendar icon in the field.

Not so obvious is the behind the scenes changes. The Domino server outputs dates in a certain format. The Dijit DatePicker expects JSDate objects. So the Dojomino DatePicker has a couple of functions in it to change the date format to one the dijit expects. It also has a custom "serialize" function which is used to convert the date back to one that Domino will accept on http POST commands.

There is an implicit dependency with the DatePicker. For the serialize function to run and supply the correct value, the Domino form tag must be converted into a dijit.Form. When a dijit.Form is submitted, it first runs the isValid function on all the form widgets it contains, and then runs the serialize function of each widget to get the data it will submit back tot he server.

You can have that handled for you automatically by using the dojomino.ui.FormBuilder widget that automatically converts all the form fields to widgets as well as converting the Form tag itself to a dijit.Form.