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)
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() }]
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
def get_args_spec(self): req, opt = TextBox.get_args_spec(self) return req, opt + ['separators']
def get_validation_js_info(self): return TextBox.get_validation_js_info(self)
def validate_widget(self): return TextBox.validate_widget(self)
def get_args_spec(self): req, opt = TextBox.get_args_spec(self) return req + ['boxes'], opt