Hi Sven, it works when I set the object of the existing panel’s model but do not replace the model:
existModel.setObject(new List…); panel.setDefaultModel(existModel) Why doesn’t it work when replacing the model at all? panel.setDefaultModel(newModel) br, Chris > Am 19.05.2015 um 23:11 schrieb Sven Meier <[email protected]>: > > Hi, > >> panel.setDefaultModel(searchModel); > > does your panel pass its model to the repeater component? > > Regards > Sven > > > On 19.05.2015 23:04, Chris wrote: >> Hi, >> >> I have implemented the AutoComplete text field. Based on the input, I would >> like to change the model of a panel to show an updated list of elements. >> In the below code, the method #getObject of the searchModel never gets >> executed and the panel’s list is not refreshed. >> >> What might be missing? >> >> Thanks, Chris >> >> >> add(new AjaxFallbackLink("searchButton") { >> @Override >> public void onClick(AjaxRequestTarget target) { >> >> IModel<List<A>> searchModel = new ListModel<A>() { >> >> @Override >> public List<A> getObject() { >> >> List<A> list = Lists.newArrayList(); >> Map<String, A> map = service.getObjects(); >> for (String name : map.keySet()) { >> list.add(map.get(name)); >> } >> return list; >> } >> }; >> >> >> panel.setDefaultModel(searchModel); >> panel.modelChanged(); >> target.add(panel); >> >> send(getPage(), Broadcast.BREADTH, new ShowItem(target)); >> >> } >> }); >> >> >>> Am 19.05.2015 um 16:36 schrieb Sven Meier <[email protected]>: >>> >>> Sure, just implement #getChoices() accordingly. >>> >>> Have fun >>> Sven >>> >>> >>> On 19.05.2015 16:32, Chris wrote: >>>> Hi all, >>>> >>>> can the auto complete text field also be used in that way that it >>>> autocompletes words in the middle, too? >>>> Such as „minster“ for „Westminster Abbey“? In the example below only >>>> autocompletion for comparison of text start is demonstrated. >>>> >>>> http://www.wicket-library.com/wicket-examples-6.0.x/ajax/autocomplete?1 >>>> <http://www.wicket-library.com/wicket-examples-6.0.x/ajax/autocomplete?1> >>>> >>>> Thanks, Chris >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
