You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Thiago H. de Paula Figueiredo (JIRA)" <ji...@apache.org> on 2014/05/27 23:54:02 UTC

[jira] [Comment Edited] (TAP5-1783) Autocomplete mixin should provide clientId or context

    [ https://issues.apache.org/jira/browse/TAP5-1783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14010342#comment-14010342 ] 

Thiago H. de Paula Figueiredo edited comment on TAP5-1783 at 5/27/14 9:52 PM:
------------------------------------------------------------------------------

Supposing this template:

<t:textfield t:id="withContext" t:mixins="autocomplete,formgroup" context="autocompleteContext"/>

And this method for providing the context:

public Object[] getAutocompleteContext() {
    return new Object[] {1, RetentionPolicy.RUNTIME, AnnotationUseContext.MIXIN};
}

You can write this event handler:

List onProvideCompletionsFromWithContext(String partial, Integer integer,
        RetentionPolicy retentionPolicy, AnnotationUseContext annotationUseContext) { ... }

The only non-obvious detail here is that the context for the "providecompletions" event isn't the context parameter, but the partial input typed by the user followed by the values in the context parameter. In other hands, the first value of the autocomplete context will actually be the second value of the context passed to the event handler.


was (Author: thiagohp):
Supposing this template:

<t:textfield t:id="withContext" t:mixins="autocomplete,formgroup" context="autocompleteContext"/>

And this method for providing the context:

public Object[] getAutocompleteContext() {
    return new Object[] {1, RetentionPolicy.RUNTIME, AnnotationUseContext.MIXIN};
}

You can write this event handler:

List onProvideCompletionsFromWithContext(String partial, Integer integer,
        RetentionPolicy retentionPolicy, AnnotationUseContext annotationUseContext) { ... }

The only non-obvious detail here is that the context for the "providecompletions" event isn't the context parameter, but the partial input typed by the user followed by the values in the context parameter.

> Autocomplete mixin should provide clientId or context
> -----------------------------------------------------
>
>                 Key: TAP5-1783
>                 URL: https://issues.apache.org/jira/browse/TAP5-1783
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.4, 5.1.0.5
>            Reporter: Raphaël Ouazana
>            Assignee: Thiago H. de Paula Figueiredo
>              Labels: month-of-tapestry
>             Fix For: 5.4
>
>
> Hi,
> I use autocomplete mixin in a component that is rendered multiple times on a same page.
> When my onProvideCompletions() method is called, I can't know from which text field it has been.
> I think an optional parameter should be given to onProvideCompletions to specify a context or at least a clientId.
> Regards,
> Raphaël Ouazana.



--
This message was sent by Atlassian JIRA
(v6.2#6252)