On Thu, Oct 6, 2011 at 11:27 AM, dpmihai <[email protected]> wrote: > In wicket 1.4.17 I want to have AjaxFormComponentUpdatingBehavior on a > DateTimeFiled for all its components (text field, hours field, minutes > field). > > I can do this only on date text field : > > DateTimeField txtTime = new DateTimeField("txtTime", generalModel) { > > @Override > protected DateTextField newDateTextField(String id, PropertyModel > dateFieldModel) { > DateTextField f = super.newDateTextField(id, > dateFieldModel); > f.add( new > AjaxFormComponentUpdatingBehavior("onchange") { > @Override > protected void onUpdate(AjaxRequestTarget > target) {...} > }); > return f; > } > }; > > But TextField's for hours and minutes are private and do not have similar > methods to overwrite. > Does anyone use another approach instead of rewriting the hole class again? No need to rewrite. You can get the field with: dateTimeField.get(DateTimeField.HOURS).add(new AjaxFormComponentUpdatingBehavior() ...) > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/DateTimeField-and-AjaxFormComponentUpdatingBehavior-tp3877416p3877416.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
-- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
