tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiago H. de Paula Figueiredo (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-1783) Autocomplete mixin should provide clientId or context
Date Tue, 27 May 2014 21:50:02 GMT

    [ 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 commented on TAP5-1783:
-----------------------------------------------------

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)

Mime
View raw message