1. SmartClient Version: v9.1p_2014-04-08/Pro Development Only (built 2014-04-08)
2. All browsers (f.e. Chrome Version 0.0.2214.111 m)
3. When object is sent from server to UI as a data of DMI callback, its JSON view differs in case enum is composed in it.
result in UI:
however I expect the same behavior:
My question is: how can I get the same result by passing enum to UI?
2. All browsers (f.e. Chrome Version 0.0.2214.111 m)
3. When object is sent from server to UI as a data of DMI callback, its JSON view differs in case enum is composed in it.
Code:
public enum DataType {
A("a", "a"),
B("b", "a");
private String s1;
private String s2;
DataType(String s1, String s2) {
this.s1 = s1;
this.s2 = s2;
}
public String getS1() {
return s1;
}
public String getS2() {
return s2;
}
public boolean isSupported() {
return s1.equals(this);
}
}
public enum FieldType {
A("a", "a") {
@Override
public boolean isSupported() {
return true;
}
},
B("b", "a") {
@Override
public boolean isSupported() {
return false;
}
};
private String s1;
private String s2;
DataType(String s1, String s2) {
this.s1 = s1;
this.s2 = s2;
}
public String getS1() {
return s1;
}
public String getS2() {
return s2;
}
public abstract boolean isSupported;
}
public class CustomDto implements Serializable {
private static final long serialVersionUID = 1L;
private FieldType fieldType;
private DataType dataType;
public FieldType getFieldType() {
return fieldType;
}
public void setFieldType (FieldType ft) {
this.fieldType = ft;
}
public DataType getDataType() {
return dataType;
}
public void setDataType (DataType dt) {
this.dataType= dt;
}
}Code:
{
dataType: "A",
fieldType: {
class: "com. ... .FieldType",
s1: "a",
s2: "a",
supported: true
}
}Code:
{
dataType: "A",
fieldType: "A"
}My question is: how can I get the same result by passing enum to UI?