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
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P2 | |
Assignee | Adnan Durrani [ adnan.durrani ] |
Ken Fyten
made changes -
Fix Version/s | 1.7 [ 10080 ] |
Ken Fyten
made changes -
Fix Version/s | 1.7RC1 [ 10123 ] | |
Fix Version/s | 1.7 [ 10080 ] |
Adnan Durrani
made changes -
Status | In Progress [ 3 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #15923 | Tue Mar 04 12:26:00 MST 2008 | adnan.durrani | Fix for Michael's suggestion applied |
Files Changed | ||||
ADD
/icefaces/trunk/icefaces/component/src/com/icesoft/faces/model/SetDataModel.java
MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelseries/UISeries.java ADD /icefaces/trunk/icefaces/component/src/com/icesoft/faces/model |
Adnan Durrani
made changes -
Status | Open [ 1 ] | In Progress [ 3 ] |
Ken Fyten
made changes -
Fix Version/s | 1.7 [ 10080 ] |
Ken Fyten
made changes -
Field | Original Value | New Value |
---|---|---|
ICEfaces Forum Reference | http://www.icefaces.org/JForum/posts/list/7230.page | |
Affects | [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration] | |
Assignee Priority | P2 | |
Assignee | Adnan Durrani [ adnan.durrani ] |
Michael Thiem
created issue -
Michael's suggestion applied.
revision : 15923
By adding the Set support, the following concrete types can be used as the dataModel:
-TreeSet