Absolutely. You should be able to use any Dojo widget type that is available in your current environment.
The specific case of using the example OracleDateTextBox is a little trickier, because the Spring.ElementDecoration assumes you need to have a dojo.require statement before constructing an instance of the widgetType. But there is an optional widgetModule parameter that is used when you need to require something other than the given widgetType.
So in this specific case, the brute force way would be to put the custom widget declaration:
Code:
dojo.require("dijit.form.DateTextBox");
dojo.declare("OracleDateTextBox",[dijit.form.DateTextBox], {
serialize: function(d, options) {
return dojo.date.locale.format(d, {selector:'date', datePattern:'dd-MMM-yyyy'}).toLowerCase();
}
});
of the OracleDateTextBox in the <head> section of the page. Then the decoration could be something like:
Code:
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "checkoutDate",
widgetType : "OracleDateTextBox",
widgetModule : "dijit.form.DateTextBox",
widgetAttrs : { value : dojo.date.locale.parse(dojo.byId("checkoutDate").value, {selector : "date", datePattern : "yyyy-MM-dd"}), required : true }
}));
In this case the dojo.require of the widgetModule type would end up being a no-op since you already required "dijit.form.DateTextBox" in the <head>.
The better way would be to package OracleDateTextBox into its own module (as the linked dojo docs suggest) so that it can be dojo.required without the additional widgetModule parameter in the decoration.