|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sf.net.kayestry.GenericSelectionModel
public class GenericSelectionModel
Genera un selection model a partir de una lista de objetos. Para cada
elemento, el codigo y la etiqueta a usar se obtienen a partir de obtener por
refleccion. Para el codigo se obtiene el valor del property id
.
Para la etiqueta, se utiliza el valor del property que tiene la constante
DEFAULT_LABEL
si no se especifica ninguna o la que se le pase
al constructor.
DEFAULT_LABEL
,
GenericSelectionModel(List, String, boolean)
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_LABEL
Property a usar para obtener el valor de la etiqueta. |
Constructor Summary | |
---|---|
GenericSelectionModel(java.util.List data)
Crea un nuevo GenericSelectionModel. |
|
GenericSelectionModel(java.util.List data,
java.lang.String label)
Crea un nuevo GenericSelectionModel. |
|
GenericSelectionModel(java.util.List data,
java.lang.String label,
boolean returnId)
Crea un nuevo GenericSelectionModel. |
Method Summary | |
---|---|
java.lang.String |
getLabel(int index)
|
java.lang.Object |
getOption(int index)
|
int |
getOptionCount()
|
java.lang.String |
getValue(int index)
|
java.lang.Object |
translateValue(java.lang.String value)
A partir de un indice, se devuelve el valor del elemento. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_LABEL
Constructor Detail |
---|
public GenericSelectionModel(java.util.List data)
(data, null, true)
.
data
- GenericSelectionModel(List, String, boolean)
public GenericSelectionModel(java.util.List data, java.lang.String label)
returnId
en true
.
data
- label
- GenericSelectionModel(List, String, boolean)
public GenericSelectionModel(java.util.List data, java.lang.String label, boolean returnId)
data
- La lista con datos para crear el combolabel
- El nombre del atributo que se usa como label en la lista de
opciones. Si es null, se toma el valor de
DEFAULT_LABEL
.returnId
- Dependiendo de este valor es lo que se devuelve en
translateValue(String)
.translateValue(String)
Method Detail |
---|
public int getOptionCount()
getOptionCount
in interface org.apache.tapestry.form.IPropertySelectionModel
public java.lang.Object getOption(int index)
getOption
in interface org.apache.tapestry.form.IPropertySelectionModel
public java.lang.String getLabel(int index)
getLabel
in interface org.apache.tapestry.form.IPropertySelectionModel
public java.lang.String getValue(int index)
getValue
in interface org.apache.tapestry.form.IPropertySelectionModel
public java.lang.Object translateValue(java.lang.String value)
returnId
pasado en el constructor es el objeto
que se devuelve. Cuando se usa true
se devuelve el id del
objeto, caso contrario se devuelve el objeto entero.
translateValue
in interface org.apache.tapestry.form.IPropertySelectionModel
returnId
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |