When web enabling old Domino forms date fields has never been fun. users setting the wrong format, and the save breaks the form giving a error 500. There has been alot of dhtml calendar pickers that has been used some better and some worse of handling other browses than IE. We all have these applications that is very large and that you don’t can convert directly to XPages, then adding dojo to your old forms can help you.
What do you need to do to get a dojo calendar control to work with a old date field in a form, not much actually. Dojo is really good of helping you to do this move.
First you have to decide if you want to host the dojo toolkit locally or thru i.e Google CDN.
It’s just the url:s in my example that you need to change if you want to host the dojo files in the html directory on your Domino server.
Add the following with passthru html to a subform
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js"
djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
dojo.require("dijit.form.DateTextBox");
</script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dijit/themes/tundra/tundra.css"/>
Update:
In 8.5.3 you could use this internal url to dojo instead of the CDN
/xsp/.ibmxspres/dojoroot-1.6.1/dojo/dojo.js
When this is done you need to add this subform to your form.
You also need to add the theme class to the body attribute section of the form.
“class=\”tundra\”
On your date fields on the form add the following to the HTML attributes to the field
“dojoType=\”dijit.form.DateTextBox\” ”
And your done, add the last row to all your date fields to get a calendar control in all of them.
This calendar control will use browser locale when deciding how the date should be displayed.
Or you can like I like to do set a pattern that matches the date format on the server by changing the dojo type we specified on the field to
“dojoType=\”dijit.form.DateTextBox\” constraints={datePattern:’yy-MM-dd’}”
The Dojo series will continue with more controls both in traditional Notes and in XPages.
Enjoy