Hi Tom,

According to https://twitter.github.io/typeahead.js/examples/ you should
generate JS like:

$('#custom-templates .typeahead').typeahead(null, {
  name: 'best-pictures',
  display: 'value',
  source: bestPictures,
  templates: {
    empty: [
   ...

So you need a Typeahead component, with typeaheadV10.TypeaheadConfig
that has first Dataset as null, and a second with the templates.

Looking at the JS snippet I think the Templates type should be
AbstractConfig, but it Json.RawValue :-/ You can workaround this by
using new Json.RawValue("empty: 'your template for empty here'").

You may want to subscribe to
https://groups.google.com/forum/#!forum/wicket-bootstrap. Maybe the
contributor of this component is subscribed there and would have
responded earlier with a better response than me.


Martin Grigorov
Freelancer. Available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Jun 23, 2015 at 3:12 PM, Tom Götz <t...@decoded.de> wrote:

> Hi,
>
> I’m currently trying to implement a Typeahead component using the
> wicket-bootstrap project (v 0.10.1, Wicket version 7.0.0-M5).
> Is there some example how the template mechanism can be used
> (de.agilecoders.wicket.extensions.markup.html.bootstrap.form.typeaheadV10.DataSet#Templates)?
> I found one Typeahead example in the wicket-bootstrap-samples project, but
> no templates are used there. I’m looking for a way to e.g. add icons to
> each individual suggestion …
>
> Any hint or small code sample available?
>
> Cheers,
>    -Tom
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to