You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Erik de Hair <er...@pocos.nl> on 2014/07/01 15:43:41 UTC

Autocomplete doesn't get triggered

Hi,

I try to use a autocomplete method for an action param but it doesn't get triggered. The signature is:

public List<String> autoComplete11InportMSISDN(String search)

Any idea?

Thanks,
Erik

Re: Autocomplete doesn't get triggered

Posted by Jeroen van der Wal <je...@stromboli.it>.
Tell your class which repository and action to use:

@AutoComplete(repository = Parties.class, action = "autoComplete")
public class Party {
    ...
}

Implement the action to handle the user input:

public class Parties {
    @Hidden
    public List<Party> autoComplete(final String searchPhrase) {
        return searchPhrase.length() > 2
                ? findParties("*" + searchPhrase + "*")
                : Lists.<Party> newArrayList();
    }

    @ActionSemantics(Of.SAFE)
    public List<Party> findParties(
            final @Named("Reference or Name") @DescribedAs("May
include wildcards '*' and '?'")
            String referenceOrName) {
        return allMatches("matchByReferenceOrName",
                "referenceOrName",
StringUtils.wildcardToCaseInsensitiveRegex(referenceOrName));
    }
}

Full source code here:
https://github.com/estatio/estatio/tree/master/dom/src/main/java/org/estatio/dom/party




On Wed, Jul 2, 2014 at 12:26 PM, Erik de Hair <er...@pocos.nl> wrote:
> Hi Dan,
>
> Ok, that's clear.
>
> But how does the search text box for choices operate? When I type a search string it underlines matching options only but doesn't apply a filter on the full list. Is that the expected behavior?
>
> Erik
>
> ________________________________________
> From: Dan Haywood [dan@haywood-associates.co.uk]
> Sent: Tuesday, July 01, 2014 3:46 PM
> To: users
> Subject: Re: Autocomplete doesn't get triggered
>
> autocomplete is (currently) only for entities.
>
> Options:
> - keep with string and use List<String> choices11Xxx
> - if string is derived from an entity (eg its name), then use that entity
> instead.
>
> Dan
>
>
>
> On 1 July 2014 14:43, Erik de Hair <er...@pocos.nl> wrote:
>
>> Hi,
>>
>> I try to use a autocomplete method for an action param but it doesn't get
>> triggered. The signature is:
>>
>> public List<String> autoComplete11InportMSISDN(String search)
>>
>> Any idea?
>>
>> Thanks,
>> Erik
>>

RE: Autocomplete doesn't get triggered

Posted by Erik de Hair <er...@pocos.nl>.
Hi Dan,

Ok, that's clear.

But how does the search text box for choices operate? When I type a search string it underlines matching options only but doesn't apply a filter on the full list. Is that the expected behavior?

Erik

________________________________________
From: Dan Haywood [dan@haywood-associates.co.uk]
Sent: Tuesday, July 01, 2014 3:46 PM
To: users
Subject: Re: Autocomplete doesn't get triggered

autocomplete is (currently) only for entities.

Options:
- keep with string and use List<String> choices11Xxx
- if string is derived from an entity (eg its name), then use that entity
instead.

Dan



On 1 July 2014 14:43, Erik de Hair <er...@pocos.nl> wrote:

> Hi,
>
> I try to use a autocomplete method for an action param but it doesn't get
> triggered. The signature is:
>
> public List<String> autoComplete11InportMSISDN(String search)
>
> Any idea?
>
> Thanks,
> Erik
>

Re: Autocomplete doesn't get triggered

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
autocomplete is (currently) only for entities.

Options:
- keep with string and use List<String> choices11Xxx
- if string is derived from an entity (eg its name), then use that entity
instead.

Dan



On 1 July 2014 14:43, Erik de Hair <er...@pocos.nl> wrote:

> Hi,
>
> I try to use a autocomplete method for an action param but it doesn't get
> triggered. The signature is:
>
> public List<String> autoComplete11InportMSISDN(String search)
>
> Any idea?
>
> Thanks,
> Erik
>