예제 #1
0
 def set_arg(self, arg, val):
     if arg == 'initial_value':
         form = self.get_form()
         ndate, ntime = self._make_widget_names()
         form.get_widget(ntime).set_arg('initial_value', val)
         form.get_widget(ndate).set_arg('initial_value', val)
     else:
         TextBox.set_arg(self, arg, val)
예제 #2
0
    def get_validation_js_info(self):
        r = TextBox.get_validation_js_info(self)
        me = 'document.getElementById("%s")' % self.get_html_id()

        return r + [{
            'msg': 'Invalid number',
            'validate': 'isNaN(%s)' % self.calljs_getvalue(),
            'onselect': me + '.focus()',
            'markitem': self.get_html_id()
        }]
예제 #3
0
    def get_calc_html_attrs(self):
        calcdict = TextBox.get_calc_html_attrs(self)

        html_id = self.get_html_id()
        calcdict['onfocus'] = ('mcw_numeric_focus("%s");' %
                               html_id) + calcdict.get('onfocus', '')
        calcdict['onblur'] = ('mcw_numeric_blur("%s");' %
                              html_id) + calcdict.get('onblur', '')
        calcdict['value'] = self._number_mac_to_human(str(self.get_value()))
        calcdict['align'] = 'right'

        return calcdict
예제 #4
0
 def get_args_spec(self):
     req, opt = TextBox.get_args_spec(self)
     return req, opt + ['separators']
예제 #5
0
 def get_validation_js_info(self):
     return TextBox.get_validation_js_info(self)
예제 #6
0
 def validate_widget(self):
     return TextBox.validate_widget(self)
예제 #7
0
 def get_args_spec(self):
     req, opt = TextBox.get_args_spec(self)
     return req + ['boxes'], opt
예제 #8
0
 def get_validation_js_info(self):
     return TextBox.get_validation_js_info(self)
예제 #9
0
 def validate_widget(self):
     return TextBox.validate_widget(self)
예제 #10
0
 def get_args_spec(self):
     req, opt = TextBox.get_args_spec(self)
     return req + ['boxes'], opt