If you are working with PropertyModel / CompoundPropertyModel, then just set your field to null. Add the textField (or its container) to the Ajax-Target.
That should work. Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Thu, Jan 14, 2010 at 6:55 AM, Steve Swinsburg <steve.swinsb...@gmail.com>wrote: > Hello all, > > I have a list of items and an ajax form at the bottom so you can add items > to the list, containing a single textfield and a submit button. On > successful submit, the item is saved and the list is redrawn. Great! > I want to clear the textfield though so new items can be added, since the > textfield and form stays on page at all times. > > I tried: > > textField.clearInput(); > target.addComponent(textField); > > and > > form.clearInput(); > target.addComponent(form); > > and a few combinations of the above (!) but to no avail. Are these methods > meant to clear the raw input from either the FormComponent or the Form > itself? I would have thought so. The only way I could get it cleared was: > > textField.setModelObject(null); > > Is this how its meant to be or a bug? Just double checking. > > cheers, > Steve > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >