fld = ((PropertyAdapterField)field).getField();
}
if (itemDef.isNode()) {
// case of a new link node
if (fld instanceof ContentPickerField) {
ContentPickerField pck = (ContentPickerField) fld;
List<GWTJahiaNode> selection = pck.getValue();
for (GWTJahiaNode node : selection) {
values.add(new GWTJahiaNodePropertyValue(node, GWTJahiaNodePropertyType.PAGE_LINK));
}
}
// case of a file upload
else {
values.add(new GWTJahiaNodePropertyValue(fld.getValue().toString(),
GWTJahiaNodePropertyType.ASYNC_UPLOAD));
}
} else {
GWTJahiaPropertyDefinition propDef = (GWTJahiaPropertyDefinition) itemDef;
// case of a list property
if (fld instanceof DualListField) {
List<GWTJahiaValueDisplayBean> selection =
((DualListField<GWTJahiaValueDisplayBean>) fld).getToList().getStore().getModels();
for (GWTJahiaValueDisplayBean valueDisplayBean : selection) {
GWTJahiaNodePropertyValue propertyValue =
getPropertyValue(valueDisplayBean, propDef.getRequiredType());
if (propertyValue != null) {
values.add(propertyValue);
}
}
}
// case of a reference
else if (fld instanceof ContentPickerField) {
ContentPickerField pck = (ContentPickerField) fld;
List<GWTJahiaNode> selection = pck.getValue();
for (GWTJahiaNode node : selection) {
GWTJahiaNodePropertyValue propertyValue =
new GWTJahiaNodePropertyValue(node, propDef.getRequiredType());
values.add(propertyValue);
}