- All Implemented Interfaces:
Serializable,IDetachable,IClusterable
A simple
StringTextChoiceProvider for Strings.- Author:
- Tom Götz (tom@decoded.de)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDisplayValue(String choice) Get the value for displaying to an end user.getIdValue(String choice) This method is called to get the id value of an object (used as the value attribute of a choice element) The id can be extracted from the object like a primary key, or if the list is stable you could just return a toString of the index.toChoices(Collection<String> ids) Converts a list of choice ids back into application's choice objects.Methods inherited from class org.wicketstuff.select2.ChoiceProvider
detach, query, toJson
-
Constructor Details
-
StringTextChoiceProvider
public StringTextChoiceProvider()
-
-
Method Details
-
getDisplayValue
Description copied from class:ChoiceProviderGet the value for displaying to an end user.- Specified by:
getDisplayValuein classChoiceProvider<String>- Parameters:
choice- the actual object- Returns:
- the value meant for displaying to an end user
-
getIdValue
Description copied from class:ChoiceProviderThis method is called to get the id value of an object (used as the value attribute of a choice element) The id can be extracted from the object like a primary key, or if the list is stable you could just return a toString of the index.Note that the given index can be
-1if the object in question is not contained in the available choices.- Specified by:
getIdValuein classChoiceProvider<String>- Parameters:
choice- The object for which the id should be generated- Returns:
- String
-
toChoices
Description copied from class:ChoiceProviderConverts a list of choice ids back into application's choice objects. When the choice provider is attached to a single-select component theidscollection will contain exactly one id, and a collection containing exactly one choice should be returned.- Specified by:
toChoicesin classChoiceProvider<String>- Parameters:
ids- collection containing choice ids- Returns:
- collection containing application choice objects
-