Hello,
Have a look at the datatable-autocomplete project in wicketstuff-core:
(maven details: org.wicketstuff:datatable-autocomplete:1.4.17.2)
It allows you to show the autocomplete matches in a datatable which lets
you show what ever fields of the object you want and have full control
over how they are rendered.
The datatable-autocomplete-example application indexes java methods from
the JVM's rt.jar (it depends on the jvm but it should be in the range of
70-90,000 methods).
Here is how the AutoCompletingTextField is setup:
https://github.com/wicketstuff/core/blob/core-1.4.x/jdk-1.5-parent/datatable-autocomplete-parent/datatable-autocomplete-examples/src/main/java/org/wicketstuff/datatable_autocomplete/web/page/HomePage.java#L215
Run it like this:
MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128M mvn jetty:run
The example uses a PatriciaTrie as the data source (i.e. we read all of
the objects into memory and index them for fast prefix searches) but the
underlying datatable just takes an IDataProvider so it would be possible
to use other data sources aswell.
Your most recent question on this thread is about how to do stuff on
selection of a row so in the case of datatable-autocomplete that would
be done implementing the ITableRowSelection<T> interface. (the example
shows this, you update the models for the components impacted by the
selection and then target.addComponent(field) to get them updated in the
browser).
Regards,
Mike
here's the situation .. I have an Object with address data(street, house
number, city, etc) .. so I use Autocomplete to search for streets meanin ..
user writes in street name and dropdown shows .. street name and city in
wich street is in (meaning same streets can exists in different cities) ..
so when choice is selected only street is written to the text box .. and
when I wanted to use a converter same street names occur on many choices so
equals method is not appropriate for checking .. cause user might have
selected the 3rd choice and converter would get me an object with the first
one it finds .. and ... NO I cant pust city beside street in text field,
cause city is in it's own field ;) .. that's why I'm trying to get the
object autocomplete field and not this text autocomplete field ..
but hey .. thank you for your help ;)
regards
Armando
PS: cant believe nobody ever needed anything like this :D
--
View this message in
context:http://apache-wicket.1842946.n4.nabble.com/Autocomplete-get-model-object-tp3649960p3650048.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail:users-unsubscr...@wicket.apache.org
For additional commands, e-mail:users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org