E
- choice definitionF
- parent data objectpublic class MultipleChoiceDataObjectField<E extends FieldChoiceDefinition<E>,F extends DataObject<F>> extends DataObjectField<MultipleChoiceDataObjectFieldDefinition<E,F>,F>
Modifier and Type | Field and Description |
---|---|
protected StoredField<java.lang.String> |
storedvalue |
definition, field, parentpayload
Constructor and Description |
---|
MultipleChoiceDataObjectField(MultipleChoiceDataObjectFieldDefinition<E,F> definition,
DataObjectPayload parentpayload,
E choicedefinition)
creates a multi-choice field
|
Modifier and Type | Method and Description |
---|---|
void |
addChoice(ChoiceValue<E> choice)
adds a choice inside this field
|
SimpleDataElt |
getDataElement() |
ChoiceValue<E> |
getSelectedChoiceAt(int index)
get the choices at index
|
int |
getSelectedChoiceNr() |
java.lang.String |
getStorageString() |
ChoiceValue<E>[] |
getValue() |
void |
loadNewStorageString(java.lang.String storagestring)
sets the content of the field according to storage string (codes of values
separated by '|')
|
void |
postTreatmentAfterInitFromDB()
A placeholder to allow data object elements to perform some postprocessing
after initialization from database
|
void |
reset()
empty the content of the multiple field
|
void |
setValue(ChoiceValue<E>[] choices)
set the payload of this field to the given list of choices
|
void |
setValue(MultipleChoiceDataElt<?> thischoicefield)
sets the value of the field to this payload
|
getAllTriggersForRefresh, getFieldFromName, getFieldNumber, getStoredField, getTriggersForThisUpdate, initFromDB
changeName, cleanName, equals, getName
protected StoredField<java.lang.String> storedvalue
public MultipleChoiceDataObjectField(MultipleChoiceDataObjectFieldDefinition<E,F> definition, DataObjectPayload parentpayload, E choicedefinition)
definition
- definition of the multi-choice fieldparentpayload
- payload of the parent data objectchoicedefinition
- definition of the choicepublic SimpleDataElt getDataElement()
getDataElement
in class DataObjectField<MultipleChoiceDataObjectFieldDefinition<E extends FieldChoiceDefinition<E>,F extends DataObject<F>>,F extends DataObject<F>>
public void loadNewStorageString(java.lang.String storagestring)
storagestring
- storage stringpublic void addChoice(ChoiceValue<E> choice)
choice
- choice to addpublic int getSelectedChoiceNr()
public ChoiceValue<E> getSelectedChoiceAt(int index)
index
- an index between 0 (included) and SelectedChoiceNr (excluded)public java.lang.String getStorageString()
public void reset()
public void setValue(ChoiceValue<E>[] choices)
choices
- list of choicespublic void setValue(MultipleChoiceDataElt<?> thischoicefield)
thischoicefield
- a multiple choice fieldpublic void postTreatmentAfterInitFromDB()
DataObjectElement
postTreatmentAfterInitFromDB
in class DataObjectElement<MultipleChoiceDataObjectFieldDefinition<E extends FieldChoiceDefinition<E>,F extends DataObject<F>>,F extends DataObject<F>>
public ChoiceValue<E>[] getValue()