Hi, Please read http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/
On Tue, Nov 27, 2018 at 10:29 AM ShengChe Hsiao <front...@gmail.com> wrote: > Dears > > I have a form with listview which dynamically add TextField in it, but when > i enter some text in other fields and click add button to add TextField in > listview, the form cleared and I don't want this, do you have any > suggestions? > > > redirecturis = new ListView<String>("rows", > serviceProviderModel.getRedirecturi()) { > @Override > protected void populateItem(ListItem<String> listItem) { > listItem.add(new RequiredTextField("redirecturi", > listItem.getModel())); > } > }; > > > > AjaxSubmitLinkBlockUI btnAdd = new AjaxSubmitLinkBlockUI("btnAdd", > spregform) { > @Override > protected void onSubmit(AjaxRequestTarget target, Form<?> form) { > super.onSubmit(target, form); > logger.info("Form Data Add uri : {}", > serviceProviderModel.toString()); > > //serviceProviderModel.setRedirecturi(serviceProviderModel.getRedirecturi()); > serviceProviderModel.getRedirecturi().add(""); > //spregform.setDefaultModelObject(serviceProviderModel); > spregform.modelChanged(); > target.add(spregform); > target.add(container); > //target.add(formUpdateIcon); > > //target.add(container); > } > }; > > > -------------------------------------------------------------------- > -----------------------------------> > To boldly go where no man has gone before. > -------------------------------------------------------------------- > -----------------------------------> > We do this not because it is easy. We do this because it is hard. > ----------------------------------------------------------------- > --------------------------------------> > If I have seen further it is by standing on the shoulders of giants. > ---------------------------------------------------------- > ---------------------------------------------> > front...@gmail.com > > ---------------------------------------------------------------------------------------------> >