2
我有一個jsp頁面,其中包含一個由連接到後端java服務器的dojo.data.ItemFileReadStore填充的dijit.form.ComboBox。它的工作方式與預期一致,組合框可以正確顯示結果。問題是我收到一個'dojo.data.ItemFileReadStore:無效的項目參數。'當使用鍵盤箭頭鍵在結果列表中滾動時。然而用鼠標選擇工作正常。dojo.data.ItemFileReadStore:與Dijit組合框無效的項目參數
道場版本1.2.3
這是怎麼了,我已經把它在的地方我的jsp:
<input type="text" id="value"
dojoType="dijit.form.ComboBox"
autoComplete="false"
searchAttr="name"
forceValidOption="true"
hasDownArrow="false"
onKeyUp="populateValue"
/>
<script type="text/javascript">
function populateValue() {
valueWidget = dijit.byId("value");
var selectedValue = valueWidget.getValue();
var url = "${contextPath}/someUrl?selectedValue=" + selectedValue + "%";
store = new dojo.data.ItemFileReadStore({url:url});
valueWidget.store = store;
return;
}
</script>
下面是我從服務器接收的JSON:
{"items":[
{"name":"My string 1","label":"My string 1"},
{"name":"My string 2","label":"My string 2"},
{"name":"Mev.","label":"Mev."}],
"identifier":"name"}
任何想法這裏怎麼回事?
謝謝!它解決了它。但爲什麼發生這種事情不明白 – 2011-10-31 11:15:57
@NeelBasu你終於解決了這個問題?你找到原因了嗎? – MockerTim 2013-08-27 11:16:50
好吧,這是一個2歲的故事,我不記得我在做什麼:) – 2013-08-27 18:37:52