Array_Of_ListElement<ListElement> clonedList = CloneHelper.clone(pList, false);
Object currValue = null;
if (this.theModel != null) {
if (this.theModel instanceof ListElementValueModelConverter) {
// TF:20/11/2009:DET-127:Changed this to use a new method on the converter
ListElementValueModelConverter converter = (ListElementValueModelConverter)this.theModel;
currValue = converter.getCurrentValue();
converter.setElements(pList);
}
else {
currValue = this.theModel.getValue();
}
}
this.elements = clonedList;
if (!this.isFillIn && this.theModel != null) {
this.theModel.setValue(currValue);
if (this.theModel instanceof ListElementValueModelConverter) {
ListElementValueModelConverter conv = (ListElementValueModelConverter)this.theModel;
if (conv.getCurrentValue() == null && this.getBoundType() != null &&
!DataValue.class.isAssignableFrom(this.getBoundType())) { //PM:29/11/07 don't set default value if it is null
this.theModel.setValue(clonedList.get(0));
}
// CraigM:11/08/2008 - If we have tried to set a value before, and it didn't exist in the list, then try to set it again now.
int index = ((ListElementValueModelConverter)this.theModel).getFailedSetIndex();