ArcGIS JavaScript API – Replacing dijit.ComboBox with dijit.Select Results in Error

arcgis-javascript-apicombo-boxdojoiosselect

I am currently populating a Dojo ItemFileReadStore with the results of an ArcGIS query (Javascript 3.4 API), which is then passed to a Dijit COmboBox.
I am now having problems with the ComboBox in iOS (see http://grokbase.com/t/dojo/dojo-checkins/132kx1h9jj/dojo-toolkit-16730-combobox-long-drop-down-lists-broken-on-ios). It looks like a dijit.Form.Select might work (although not ideal, b/c there is no autoComplete or placeholders); It works fine on my iPhone for the dropdown lists that I hard-coded. But I am getting an error that I believe is related to the ItemFileReadStore, and the results of my query are not being passed into the select dropdown menu.

In my HTML, I tried simply replacing ComboBox with Select:

    <select id="Select" dojotype="dijit.form.Select"
    value="" class="comboBoxClass"  onchange= "setName(this)"

My store is still set up the same way as I had before:

    var dataItems = {
    identifier : 'name',
    label : 'name',
    items : values
};

var menuStore = new dojo.data.ItemFileReadStore({
    data : dataItems,
    clearOnClose : true
});

…and the Select box is given the store's values the same as before:

    dijit.byId("menu").set("store", menuStore);

menuStore.fetch({
    onComplete : completed,
    onError : error,
    sort : sortAttributes
});

I added:

  dojo.require("dijit.form.Select");
  dojo.require("dojo.parser");

to my init file…

But I am getting this error in Firebug:

  dojo/parser::parse() error
  TypeError: _7.getLocalization(...) is undefined

In Chrome there is also an error with dojo/parser:

 message: "Cannot read property 'missingMessage' of undefined"

(I also tried swapping ComboBox with FilteringSelect, but the iOS problems are the same.)

Ideas?
note, this question is somewhat of an extension to an earlier question I had regarding specifically the iOS issue with the Dijit ComboBox (combobox GIS SE question)…I would happily, actually rather, still use the ComboBox if there is some way to make it work properly on an iPhone! but I can live with the Dijit.form.Select box if that is what I must do….)

Best Answer

I found this link which gave the primary reason this wasn't working: apparently with versions 3+ of the ArcGIS JS API (using Dojo 1.8+), dijit layout forms can break the code if there is a 'lang' tag in the HTML, which I had. No more parse error after I deleted this tag.
Also, more dumbly, I was not explicitly assigning the option values when I switched from ComboBox to Select dijits. For the ComboBox, it was sufficient to simply assign the dropdown options as "<option>thing</option>"...but for the Select dijit I needed "<option.value="thing">thing</option>". Without this change, I was not firing the onchange event when selecting an option using a Select form.
Also, to create the store using dijit.form.Select, I needed to edit the syntax to set the store:

dijit.byId("menu").setStore(menuStore);

Now my Select dropdown menus work, but sadly they still are wonky on iPhones and Androids!

Related Question