Changeset 12985
- Timestamp:
- 03/09/08 09:20:01 (9 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 modified
-
form/ComboBox.js (modified) (5 diffs)
-
tests/form/test_ComboBox.html (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/form/ComboBox.js
r12965 r12985 405 405 this._isShowingNow=false; 406 406 dijit.setWaiState(this.comboNode, "expanded", "false"); 407 dijit.removeWaiState(this.focusNode,"activedescendant"); 407 408 } 408 409 }, … … 453 454 // get the text that the user manually entered (cut off autocompleted text) 454 455 this.focusNode.value = this.focusNode.value.substring(0, this._getCaretPos(this.focusNode)); 456 //set up ARIA activedescendant 457 dijit.setWaiState(this.focusNode, "activedescendant", dojo.attr(node, "id")); 455 458 // autocomplete the rest of the option to announce change 456 459 this._autoCompleteText(newValue); … … 512 515 _startSearch: function(/*String*/ key){ 513 516 if(!this._popupWidget){ 514 var popupId = dojo.attr(this.domNode, "id")+ "_popup";517 var popupId = this.id + "_popup"; 515 518 this._popupWidget = new dijit.form._ComboBoxMenu({ 516 519 onChange: dojo.hitch(this, this._selectOption), 517 520 id:popupId 518 521 }); 519 dijit.setWaiState(this.textbox,"controls",popupId); // associate popup with textbox 522 dijit.removeWaiState(this.focusNode,"activedescendant"); 523 dijit.setWaiState(this.textbox,"owns",popupId); // associate popup with textbox 520 524 } 521 525 // create a new query to prevent accidentally querying for a hidden … … 704 708 var labelObject = labelFunc(item); 705 709 var menuitem = dojo.doc.createElement("li"); 710 dijit.setWaiRole(menuitem, "option"); 706 711 if(labelObject.html){ 707 712 menuitem.innerHTML = labelObject.label; … … 724 729 // display "Previous . . ." button 725 730 this.previousButton.style.display = (dataObject.start == 0) ? "none" : ""; 731 dojo.attr(this.previousButton, "id", this.id + "_prev"); 726 732 // create options using _createOption function defined by parent 727 733 // ComboBox (or FilteringSelect) class 728 734 // #2309: 729 735 // iterate over cache nondestructively 730 dojo.forEach(results, function(item ){736 dojo.forEach(results, function(item, i){ 731 737 var menuitem = this._createOption(item, labelFunc); 732 738 menuitem.className = "dijitMenuItem"; 739 dojo.attr(menuitem, "id", this.id + i); 733 740 this.domNode.insertBefore(menuitem, this.nextButton); 734 741 }, this); 735 742 // display "Next . . ." button 736 743 this.nextButton.style.display = (dataObject.count == results.length) ? "" : "none"; 744 dojo.attr(this.nextButton,"id", this.id + "_next") 737 745 }, 738 746 -
dijit/trunk/tests/form/test_ComboBox.html
r12703 r12985 72 72 73 73 <p>ComboBox #1: inlined data, autoComplete=false, default value of Iowa, pageSize=30</p> 74 <label for="setvaluetest">US State test 1 (200% Courier font):</label>74 <label for="setvaluetest">US State test 1</label> (200% Courier font): 75 75 <select id="setvaluetest" 76 76 name="state1" … … 159 159 160 160 <p>ComboBox #2: url, autoComplete=true:</p> 161 <label for="datatest">US State test 2 (8pt font): </label>161 <label for="datatest">US State test 2</label> (8pt font): 162 162 <input dojoType="dijit.form.ComboBox" 163 163 value="California" … … 172 172 <span>Value: <input id="value2" disabled value="California"></span> 173 173 <hr> 174 <label for="datatestDijit">Dijit List test #1 (150% font): </label>174 <label for="datatestDijit">Dijit List test #1</label> (150% font): 175 175 <input dojoType="dijit.form.ComboBox" 176 176 value="dijit.Editor"