Hi Freddi!
Thank you. I wanted to use it in a service, but I can manage to have the action
inside the entity.
Christian
________________________________________
From: Freddijanto [[email protected]]
Sent: Sunday, February 17, 2013 2:56 AM
To: [email protected]
Subject: Re: Dependend drop down choices
You must provide autoComplete action to have dependend choices, unless
it was an Enum.
But it does not work with action in Services.
for example
in ToDoItem.class
@AutoComplete(repository=ToDoItems.class, action="autoComplete")
public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ {
// GMAP3: uncomment to use https://github.com/danhaywood/isis-wicket-gmap3
then in ToDoItems.class
// {{ autoComplete (hidden)
@Hidden
public List<ToDoItem> autoComplete(final String description) {
return allMatches(ToDoItem.class, new Filter<ToDoItem>() {
@Override
public boolean accept(final ToDoItem t) {
return ownedByCurrentUser(t) &&
t.getDescription().contains(description);
}
});
}
// }}
Freddi
On 17/02/2013 07:10, Christian Steinebach wrote:
> Hi everybody,
>
> Is there a way to have dependend choices?
>
> Something like this:
>
> addPhone(@Named("Company") Company company,
> @Named("Model") PhoneModel model){
> Phone p = container.newInstance......
> ...
> return p;
> }
>
> choices0AddPhone(){
> return all Phone Companies
> }
>
> choices1AddPhone(Company company){
> return models(company)
> }
>
> Using the 'Process Object Pattern' as described in Dan's book wouldn't help
> if I understood it right.
> An input, like selecting the company will not be 'available' until the user
> clicked 'OK'.
> Or am I missing something?
>
> Christian
>
>
> Christian