我对 Dojo 很陌生,我遇到了以下问题。
我有以下由 spring roo 生成的表单选择:
<div id="_f_trc_suivi_domain_Pli_conteneurNum_id">
<label for="_conteneurNum_id">Conteneur Num : </label>
<select id="_conteneurNum_id" name="conteneurNum">
<option value="">Tous</option>
<option value="1">951</option>
<option value="2">753</option>
<option value="3">753159</option></select><br />
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : '_conteneurNum_id',
widgetType : 'dijit.form.FilteringSelect',
widgetAttrs : {
hasDownArrow : true
}
}));
</script>
</div>
在萤火虫中导致以下结果:
<div wairole="combobox" dojoattachpoint="comboNode"
id="widget__conteneurNum_id"
class="dijit dijitReset dijitInlineTable dijitLeft dijitTextBox dijitComboBox dijitTextBoxError dijitComboBoxError dijitError"
role="combobox" widgetid="_conteneurNum_id"
aria-labelledby="_conteneurNum_id_label" aria-expanded="false">
<div dojoattachevent="onmousedown:_onArrowMouseDown"
wairole="presentation" dojoattachpoint="downArrowNode"
class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer"
role="presentation">
<input type="text" wairole="presentation" readonly="" tabindex="-1"
value="? " class="dijitReset dijitInputField dijitArrowButtonInner"
role="presentation">
</div>
<div class="dijitReset dijitValidationContainer">
<input type="text" wairole="presentation" readonly="" tabindex="-1"
value="? "
class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner"
role="presentation">
</div>
<div class="dijitReset dijitInputField dijitInputContainer">
<input type="text" waistate="haspopup-true,autocomplete-list"
wairole="textbox" dojoattachpoint="textbox,focusNode"
dojoattachevent="onkeypress:_onKeyPress,compositionend"
autocomplete="off" class="dijitReset dijitInputInner"
role="textbox" aria-haspopup="true" aria-autocomplete="list"
id="_conteneurNum_id" tabindex="0" aria-required="true"
aria-invalid="true" value="" aria-owns="_conteneurNum_id_popup"><input
type="hidden" name="conteneurNum" value="">
</div>
</div>
但不幸的是,它总是在值为“Tous”的空白选项上方显示一个白色选项。
看下面的 gif:
我做错了什么?欢迎任何线索。
编辑:我肯定知道问题出在这个:<option value="">Tous</option>
尤其是value=""
部分。我可以改写和细化我的问题如下:我怎样才能确保 Dojo/Dijit 正确处理这个问题:value=""
??