Thank you Dan. Somehow I overlooked the second link. I got it working now. :-)
Hi Johan, these links should help: http://isis.apache.org/documentation.html, "Drop-downs & defaults" and in particular: http://isis.apache.org/how-tos/how-to-03-010-How-to-specify-a-set-of-choices-for-a-property.html http://isis.apache.org/how-tos/how-to-03-015-How-to-specify-an-autocomplete-for-a-property.html http://isis.apache.org/how-tos/how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.html Cheers Dan On 7 October 2014 21:05, wrote: > > Hi Jeroen, > > Next issue now is: how can I make it work when editing an instance of > PersonContact? There the dropdown doesn't return any searchresults.. Should > I define an action? Or is there another method? > > Hi Johan, > > It looks like you didn't inject the Persons repository into your class. > This should work: > > public List autoComplete1CreateContact(String search) { > return *persons*.findPersons(search); > } > ... > @Inject > Persons *persons*; > > > > > > > On Tue, Oct 7, 2014 at 8:54 PM, wrote: > > > > > > > Can somebody explain how to get autocomplete working in wicketviewer? I > > tried to follow [1] but I get stuck. > > > > Here is my code. The method Persons.findPersons(String search) is > working. > > Now I want to use it as a lookup in PersonContacts class to add another > > Person as a contact. But is doesn't work as I expected... > > > > > > > > > > public class PersonContacts extends SocratesDomainService{ > > > > > > > > public PersonContacts() { > > > > super(PersonContacts.class, PersonContact.class); > > > > } > > > > > > > > @MemberOrder(name = "PersonContacts", sequence = "1") > > > > @Named("Voeg contact toe") > > > > @NotInServiceMenu > > > > public PersonContact createContact( > > > > final Person owner, > > > > @Named("Contact") final Person contact, > > > > @Named("Level") final Integer level > > > > ) { > > > > final PersonContact pc = > > container.newTransientInstance(PersonContact.class); > > > > pc.setOwner(owner); > > > > pc.setContact(contact); > > > > pc.setLevel(level); > > > > container.persistIfNotAlready(pc); > > > > return pc; > > > > } > > > > > > > > public List autoComplete1CreateContact(String search) { > > > > return Persons.findPersons(search); > > } > > > > > > > > Greetz, > > > > Johan > > > > > > > > [1] > > > http://isis.apache.org/how-tos/how-to-03-025-How-to-specify-an-autocomplete-for-an-action-parameter.html > > > > > > > > > > > > �