public class HomePage.CountriesProvider extends TextChoiceProvider<Country>
Country based choice provider for Select2 components.
Demonstrates integration between Select2 components and a domain object
(in this case an enum).| Constructor and Description |
|---|
HomePage.CountriesProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getDisplayText(Country choice) |
protected Object |
getId(Country choice) |
void |
query(String term,
int page,
Response<Country> response)
Queries application for choices that match the search
term and adds them to the response |
Collection<Country> |
toChoices(Collection<String> ids)
Converts a list of choice ids back into application's choice objects.
|
toJsondetachprotected String getDisplayText(Country choice)
getDisplayText in class TextChoiceProvider<Country>protected Object getId(Country choice)
getId in class TextChoiceProvider<Country>public void query(String term, int page, Response<Country> response)
ChoiceProviderterm and adds them to the responsequery in class ChoiceProvider<Country>term - search termpage - requested search term results pageresponse - aggregate for matching choices as well as other response optionspublic Collection<Country> toChoices(Collection<String> ids)
ChoiceProviderids collection will contain exactly one id, and a collection containing
exactly one choice should be returned.toChoices in class ChoiceProvider<Country>ids - collection containing choice idsCopyright © 2015. All rights reserved.