Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.6.2, 1.7Beta1
-
Component/s: None
-
Labels:None
-
Environment:any
-
ICEsoft Forum Reference:
-
Affects:Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration
Description
example code may look like:
SetDataModel:
public class SetDataModel extends ListDataModel {
public SetDataModel() {
super();
}
public SetDataModel(Set set) {
super();
List list = new ArrayList(set);
setWrappedData(list);
}
}
change com.icesoft.faces.component.panelseries.UISeries to:
private DataModel getDataModel() {
if (null != this.dataModel) {
return (dataModel);
}
Object currentValue = getValue();
if (null == currentValue) {
this.dataModel = new ListDataModel(Collections.EMPTY_LIST);
} else if (currentValue instanceof DataModel) {
this.dataModel = (DataModel) currentValue;
} else if (currentValue instanceof List) {
this.dataModel = new ListDataModel((List) currentValue);
} else if (Object[].class.isAssignableFrom(currentValue.getClass())) {
this.dataModel = new ArrayDataModel((Object[]) currentValue);
} else if (currentValue instanceof ResultSet) {
this.dataModel = new ResultSetDataModel((ResultSet) currentValue);
} else if (currentValue instanceof Result) {
this.dataModel = new ResultDataModel((Result) currentValue);
} else if (currentValue instanceof TreeModel) {
this.dataModel = new TreeDataModel((TreeModel) currentValue);
} else if (currentValue instanceof Set) {
this.dataModel = new SetDataModel((Set) currentValue);
} else {
this.dataModel = new ScalarDataModel(currentValue);
}
return (dataModel);
}
SetDataModel:
public class SetDataModel extends ListDataModel {
public SetDataModel() {
super();
}
public SetDataModel(Set set) {
super();
List list = new ArrayList(set);
setWrappedData(list);
}
}
change com.icesoft.faces.component.panelseries.UISeries to:
private DataModel getDataModel() {
if (null != this.dataModel) {
return (dataModel);
}
Object currentValue = getValue();
if (null == currentValue) {
this.dataModel = new ListDataModel(Collections.EMPTY_LIST);
} else if (currentValue instanceof DataModel) {
this.dataModel = (DataModel) currentValue;
} else if (currentValue instanceof List) {
this.dataModel = new ListDataModel((List) currentValue);
} else if (Object[].class.isAssignableFrom(currentValue.getClass())) {
this.dataModel = new ArrayDataModel((Object[]) currentValue);
} else if (currentValue instanceof ResultSet) {
this.dataModel = new ResultSetDataModel((ResultSet) currentValue);
} else if (currentValue instanceof Result) {
this.dataModel = new ResultDataModel((Result) currentValue);
} else if (currentValue instanceof TreeModel) {
this.dataModel = new TreeDataModel((TreeModel) currentValue);
} else if (currentValue instanceof Set) {
this.dataModel = new SetDataModel((Set) currentValue);
} else {
this.dataModel = new ScalarDataModel(currentValue);
}
return (dataModel);
}
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Michael's suggestion applied.
revision : 15923
By adding the Set support, the following concrete types can be used as the dataModel:
-TreeSet