It's very easy for setting a format (I know it's no mask):
<datebox format="dd/mm/yyyy"/>
You can found it in the datebox documentation.
Other solution could be from this blog.
Edit :
I don't know why you need a mask. If you set the format to dd/mm/yyyy
you can do this :
12
loose focus => will be 12/current month selected in the calender/current year selected in calendar
122
loose focus => will be 12/02/current year selected in calendar.
0202
loose focus => will be 02/02/current year selected in calendar.
12/02
loose focus => will be 12/02/current year selected in calendar.
2/2
loose focus => will be 02/02/current year selected in calendar.
12-02
loose focus => will be 12/02/current year selected in calendar.
12--02/2012
loose focus => will be 12/02/2012.
You get the point?
ZK did implement a nice feature without most people know about it.
Like this you are also open to the clients habbits and you don't want to change it to much. (just day must be set first of course).
Try it out and give feedback if the mask is still needed when you know this.
Edit 2:
With a smart usage of the DOM structure of datebox I came up to the following :
jq("@datebox > input").mask("dd/mm/yyyy"); // all datebox get this mask
jq("$date > input").mask("dd/mm/yyyy"); // only datebox with that id get mask
This is tested on mine environment and it does work.
Edit 3:
Oke, mine enviremont was ZK 6.5.x.
Here is the fiddle where it does works :
http://zkfiddle.org/sample/4b9qh0/17-Datebox-MVVM-formatting
As you can see this works in ZK 6.5.x but not in ZK 7.0.x, So I'm still searching for that.
"span > input" works in ZK 7 but this is then for all the inputs who are in a span.
Last edit :
I've contacted ZK about this and there is a solution for ZK 7 :
jq('@datebox').find('input')
This also works for the ZK 6 so here is the updated fiddle.
And the issue is resolved in ZK 7.0.5