我在填充使用EnumMap的作爲綁定網格有一個問題:ZK ZUL迭代一個EnumMap的填充柵格
<grid sizedByContent="true" span="true" model="@bind(vm.pendingRequests[RequestType.RETURN])"
emptyMessage="Nessuna richiesta trovata" height="100%" width="100%">
在視圖模型有地圖的聲明:
private Map<RequestType, List<PendingRequest>> pendingRequests;
如果請求類型是一個枚舉:
public enum RequestType {
EXIT("exit"),
RETURN("return"),
PARKING("park");
private final String description;
private RequestType(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
public static RequestType getEnum(String value) {
if (value == null) {
throw new IllegalArgumentException();
}
for (RequestType v : values()) {
if (value.equalsIgnoreCase(v.getDescription())) {
return v;
}
}
throw new IllegalArgumentException();
}
}
你知道我錯了,在使用EnumMap的填充網格並綁定?
非常感謝!
是否有來自ZK的錯誤消息? – bidifx
ZK沒有錯誤,因爲地圖中沒有數據,它顯示爲空信息。 –
你有'pendingRequests'的公共getter嗎? – bidifx