Class AbstractObjectAutoCompleteRenderer<O>
- java.lang.Object
-
- org.wicketstuff.objectautocomplete.AbstractObjectAutoCompleteRenderer<O>
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ObjectAutoCompleteRenderer,ObjectAutoCompleteResponseRenderer
public class AbstractObjectAutoCompleteRenderer<O> extends Object implements Serializable
- Since:
- Sep 26, 2008
- Author:
- roland
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractObjectAutoCompleteRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetIdValue(O object)Get id of the object to render.protected StringgetIdValueForObject(O object)Get the verified id value for an objectprotected StringgetTextValue(O pObject)Retrieves the text value that will be set on the textbox if this assist is selected Can be overwritten, by default it returns the object's toString()protected StringgetTextValueForObject(O object)Get and check proper text valueprotected voidrenderChoice(O object, Response response, String criteria)Render the visual portion of the assist.protected voidrenderObject(O object, Response response, String criteria)voidsetIdProperty(String pIdProperty)Set the property for extracting the id of an object
-
-
-
Method Detail
-
getIdValueForObject
protected final String getIdValueForObject(O object)
Get the verified id value for an object- Parameters:
object- for which to fetch the id- Returns:
- the id
- Throws:
IllegalStateException- if the id value could not be extracted
-
getIdValue
protected String getIdValue(O object)
Get id of the object to render. By default this is extracted by reflection using theidProperty, but can be overwritten by a subclass- Parameters:
object- object from which to extract the id- Returns:
- the id value
- Throws:
IllegalArgumentException- if no id could be extracted
-
getTextValueForObject
protected final String getTextValueForObject(O object)
Get and check proper text value- Parameters:
object- object for which to get the text value- Returns:
- return the verified text value
- Throws:
IllegalStateException- if the text value could not be extracted
-
getTextValue
protected String getTextValue(O pObject)
Retrieves the text value that will be set on the textbox if this assist is selected Can be overwritten, by default it returns the object's toString()- Parameters:
pObject- assist choice object- Returns:
- the text value that will be set on the textbox if this assist is selected
-
setIdProperty
public void setIdProperty(String pIdProperty)
Set the property for extracting the id of an object- Parameters:
pIdProperty- property name of the object id
-
-