1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Defines a date entry component."""
17
18 from muntjac.ui.date_field import DateField
19 from muntjac.data.property import IProperty
20
21
23 """A date entry component, which displays the actual date selector
24 as a popup.
25
26 @see: L{DateField}
27 @see: L{InlineDateField}
28 @author: Vaadin Ltd.
29 @author: Richard Lincoln
30 @version: 1.1.2
31 """
32
34 self._inputPrompt = None
35
36 nargs = len(args)
37 if nargs == 0:
38 super(PopupDateField, self).__init__()
39 elif nargs == 1:
40 if isinstance(args[0], IProperty):
41 dataSource, = args
42 super(PopupDateField, self).__init__(dataSource)
43 else:
44 caption, = args
45 super(PopupDateField, self).__init__(caption)
46 elif nargs == 2:
47 if isinstance(args[1], IProperty):
48 caption, dataSource = args
49 super(PopupDateField, self).__init__(caption, dataSource)
50 else:
51 caption, value = args
52 super(PopupDateField, self).__init__(caption, value)
53 else:
54 raise ValueError, 'too many arguments'
55
56
58 super(PopupDateField, self).paintContent(target)
59 if self._inputPrompt is not None:
60 target.addAttribute('prompt', self._inputPrompt)
61
62
70
71
78