Select to view content in your preferred language

no dropdown arrow in combo box

8134
25
Jump to solution
08-06-2012 08:24 AM
deleted-user-ugCMpXci8bn5
New Contributor III
Hello, I hope this is a simple problem I am overlooking...

I am trying to create a combo box with hardcoded values.  What I get is a text box that does not have an arrow or drop-down functionality (the auto complete does function).

Here is what I have in the HTML (based on examples from ESRI):

            <select id="boroughSelect" dojotype="dijit.form.ComboBox"
                autoComplete="true"
                forceValidOption="false"
                onchange="executeMenuQuery(this)">

                <option>Manhattan</option>
                <option>Brooklyn</option>
                <option>Bronx</option>
                <option>Staten Island</option>
                <option>Queens</option>

            </select>


This seems like it should be pretty easy, can someone tell me what I am missing?
Thanks, Jason F.
0 Kudos
25 Replies
JohnGravois
Frequent Contributor
i'm not aware of any infoWindow specific changes at 3.1, but some other underlying changes were made at version 3.0 which might be affecting you.

in some cases it is required to load additional modules to maintain functionality compared to an application built using 2.x.  since our sample applications are updated each time a new version of the API is released, i've found it helpful to compare a live version which demonstrates some of the same functionality with something I've created previously and look for differences in which modules are loaded.

see the link below for more information:
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/migration_30.htm
0 Kudos
KellyHutchins
Esri Frequent Contributor
John is correct there weren't any 3.1 changes that should affect the info window. Can you repro the info window issue in a test page or is it only in your larger app?
0 Kudos
deleted-user-ugCMpXci8bn5
New Contributor III
I just went back to 2.1 for now and it (the infoWindow) works..it is part of the larger app.

..but the dropdown menu is still not working..I don't think that the errors related to proxy authentication should be affecting this..?  The autocomplete works, and I can enter values that correctly trigger a query (the purpose of the comboBox) but the arrow doesn't work...
0 Kudos
deleted-user-ugCMpXci8bn5
New Contributor III
I think I have found the source of the problem, but I still don't know how to correct it.
I should have stated earlier, the ComboBox is inside of a ContentPane, which is inside of a dijit AccordionContainer. I believe the problem with the ComboBox is related to the Accordion Container.
0 Kudos
KellyHutchins
Esri Frequent Contributor
Is the accordion pane that contains your dropdown visible when the page loads?

I ran a quick test using my simple sample and the dropdown displays well in the accordion pane. Can you modify this simple sample to match your accordion container code and see if that breaks?

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
        <html>
            
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
                <!--The viewport meta tag is used to improve the presentation and behavior
                of the samples on iOS devices-->
                <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"
                />
                <title>Topographic Map</title>
                <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.1/js/dojo/dijit/themes/claro/claro.css">
                <style>
                    html, body {
                        height: 100%;
                        width: 100%;
                        margin: 0;
                        padding: 0;
                    }
                    .esriScalebar {
                        padding: 20px 20px;
                    }
                    #map {
                        padding:0;
                    }
                </style>
                <script type="text/javascript">
                    var djConfig = {
                        parseOnLoad: true
                    };
                </script>
                <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.1"></script>
                <script type="text/javascript">
                    dojo.require("dijit.layout.BorderContainer");
                    dojo.require("dijit.layout.ContentPane");
                    dojo.require("esri.map");
                    dojo.require("dijit.form.ComboBox");
                    dojo.require("dijit.layout.AccordionContainer");

                    var map;

                    function init() {
                        var initExtent = new esri.geometry.Extent({
                            "xmin": -122.46,
                            "ymin": 37.73,
                            "xmax": -122.36,
                            "ymax": 37.77,
                            "spatialReference": {
                                "wkid": 4326
                            }
                        });
                        map = new esri.Map("map", {
                            extent: esri.geometry.geographicToWebMercator(initExtent)
                        });
                        //Add the topographic layer to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service    
                        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
                        map.addLayer(basemap);

                        dojo.connect(map, 'onLoad', function (theMap) {
                            //resize the map when the browser resizes
                            dojo.connect(dijit.byId('map'), 'resize', map, map.resize);
                        });
                    }

                    dojo.addOnLoad(init);
                </script>
            </head>
            
            <body class="claro">
                <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false"
                style="width: 100%; height: 100%; margin: 0;">
                    <div id='lp' dojotype='dijit.layout.AccordionContainer' region='left' style='width:300px;'>
                        <div dojotype='dijit.layout.ContentPane' title='pane1'>
                            Content for Pane 1
                        </div>
                        <div dojotype='dijit.layout.ContentPane' title='pane 2'>
                            <select id="boroughSelect" dojotype="dijit.form.ComboBox" autoComplete="true"
                            forceValidOption="false" onchange="executeMenuQuery(this)">
                                <option>Manhattan</option>
                                <option>Brooklyn</option>
                                <option>Bronx</option>
                                <option>Staten Island</option>
                                <option>Queens</option>
                            </select>
                    </div>
                    </div>
                    <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="border:1px solid #000;padding:0;"></div>
                </div>
            </body>

        </html>

0 Kudos
deleted-user-ugCMpXci8bn5
New Contributor III
Thanks, I found the source of the error, it was in the css.
I need to change your code to version 2.1 for the map to load properly.  Do I need to install an update or do something else so that I can use the 3.1 API?
Thanks for your help, Jason
0 Kudos
KellyHutchins
Esri Frequent Contributor
So if you copy the code I included in the previous post and run it locally it doesn't work unless you use 2.1? Or is it your code that doesn't work at 2.1?
Thanks, I found the source of the error, it was in the css.
I need to change your code to version 2.1 for the map to load properly.  Do I need to install an update or do something else so that I can use the 3.1 API?
Thanks for your help, Jason
0 Kudos
deleted-user-ugCMpXci8bn5
New Contributor III
..when I copy your code, it does not work using 3.1...it works when I change it to 2.1 (I haven't tried other versions).
0 Kudos
KellyHutchins
Esri Frequent Contributor
It should work just fine at 3.1 - no changes or updates required. Here's a JSFiddle with the working code:

http://jsfiddle.net/D2feS/1/
0 Kudos
deleted-user-ugCMpXci8bn5
New Contributor III
I tried your code again in Notepad++...with the same result.  Using 3.1, I get a mostly blank screen, with the drop down menu in the upper left corner...when i change the JS version to 2.1 the map works fine.  Could this be some setting on my local machine or..?
Thanks again for your help.
0 Kudos