Upgrade to 3.1 - Seeing an extra button with dojoType=dijit.form.button

519
7
09-04-2012 09:35 AM
KalaivaniNellaiappan
New Contributor
HI,
I have been upgrading my project from 1.5 to 3.1...
I am seeing an extra button pop-up by the sides of the existing button when i switch from 1.5 to 3.1?
When i go back to 1.5 it disappears...
Could you please help?
Thanks,
Vani
0 Kudos
7 Replies
KalaivaniNellaiappan
New Contributor
Hi , i have attached the screen shots...
with 1.5
[ATTACH=CONFIG]17493[/ATTACH]

with3.1
[ATTACH=CONFIG]17494[/ATTACH]

This is how i am seeing everywhere i have a dojo button...Could anyone please help?
Thanks,
Vani
0 Kudos
derekswingley1
Frequent Contributor
The easiest way to get help is to post code that reproduces the issue. Can you post a simple test page that shows the problem?
0 Kudos
KalaivaniNellaiappan
New Contributor
Here is the code and the screenshot of what i get from the code... The two long rectangle buttons which does nothing but could click on it appears when i switch from 1.5 to 3.1
Screen Shot...

[ATTACH=CONFIG]17506[/ATTACH]


Code
            <LoggedInTemplate>                       
                            <b>Required</b><br />
                            Title:<br />
                            <input type="text" id="comment-title" /><br />
                            Message:<br />
                            <textarea id="comment-message"></textarea><br /><br />

                            <b>Optional</b><br />
                            Select a point to relate this comment<br />
                            <button id="comment-select-on-map" dojoType="dijit.form.ToggleButton" iconClass="dijitCheckBoxIcon">Select on map</button><br /><br />
                         
                            Select which layer(s) to relate this comment<br />
                            <div id="comments-addcomment-panel-threats">
                            </div>
                            <a id="select-all-threats" href="javascript:void(0);">Select All</a> &mdash; <a id="unselect-all-threats" href="javascript:void(0);">Unselect All</a><br /><br />                           

                            <input type="hidden" id="comment-latitude" />
                            <input type="hidden" id="comment-longitude" />

                            <span style="display: none;">Latitude:<br />
                            <br />
                            Longitude:<br />
                            <br /></span>

                            Type:<br />
                            <select id="comment-type"><%= this.commentTypes %></select><br />
                                       
                            <input type="checkbox" id="comment-betterdata" style="width: 20px;" /> <label for="comment-betterdata">Better Data Available</label><br /><br />
                            <button id="comment-add-comment-button" dojoType="dijit.form.Button">Submit Comment</button>
                        </LoggedInTemplate>

Thanks,
Vani
0 Kudos
PaulFreeman
New Contributor
Did you ever find a solution to this?

I am getting the same when trying to upgrade from 1.4. I have narrowed it down to the changes between 2.0 and 2.1 but cannot find out what is causing the extra button. The code i am using is below.

this.button = new dijit.form.Button(
            {
  label: 'Button'
            });
0 Kudos
__Rich_
Occasional Contributor III
That can't be all the code 🙂

Could you post a full sample?  (link to site or JSFiddle probably best, otherwise if not too big then posted here using code tags, or an attachment)
0 Kudos
PaulFreeman
New Contributor
unfortunately the site is all intranet behind firewalls, the code is more than that, but even when i strip it back to the above i still get 2 buttons

dojo.provide("dcc.tool.basemap");

dojo.declare("dcc.tool.basemap", [dijit._Widget], {
    parentcontainer: "",
    load: function (node, map, file)
    {
        this.parentcontainer = node;
        this.map = map;
        this.file= file;


        if (typeof this.contentPane == 'undefined')
        {
            this.contentPane = new dijit.form.Button(
            {
                label: ' Base Map '

            });


            listnerArray.push(dojo.connect(this.contentPane.domNode, "onclick", function ()
            {
                curbmPopup.containernode.OpenPopup();
                height = (((curbmPopup.containernode.countmaps / 3) ) * 75) + 10;
                dojo.byId("bsmapnode").style.height = height + "px";
                dojo.byId("bsmapnode").innerHTML = curbmPopup.containernode.BMHtml;
                // set highlighted base map
                try
                {
                    dojo.query('#bm_' + curbmPopup.containernode.map.basemap.id)[0].style.border = "2px solid gray"
                }
                catch (e)
                {
                }

            }));
        }
        dojo.place(this.contentPane.domNode, node, "first");
        dojo.addClass(this.contentPane.domNode, "claro");

        if (typeof this.dropDown == 'undefined')
        {
            this.dropDown = new dijit.TooltipDialog(
            {
                onClose:  function(){ curLoadedPopup.isOpen = false;},
                content: '<span style="float:right;position :relative; cursor:pointer;" onclick="dijit.popup.close(curbmPopup);"><img src="' + 'image.gif" alt="X" title="Click to close"/></span><br/><center id="bsmapnode"></center>' ,
                style: "width:215px;"
            });
            dojo.addClass(this.dropDown.domNode, "claro");
            this.dropDown.startup();
       }
        this.dropDown.containernode = this;
        curbmPopup = this.dropDown;
        curLoadedPopup = this.dropDown;
        // load basemaps

        this.loadBaseMaps(environmentPath + "dcc_GIS_Config/App_Config/basemaps/"+ this.file, this);

    },
    OpenPopup: function ()
    {


        if (curLoadedPopup.isOpen){
           curLoadedPopup.isOpen = false;
           dijit.popup.close(curLoadedPopup);

        }
        else
        {

           if (typeof curLoadedPopup != 'undefined')
            {
              dijit.popup.close(curLoadedPopup);

            }

        this.popup = dijit.popup.open(
        {
            popup: this.dropDown,
            around: this.contentPane.domNode,
            orient: {
                BL: 'TL'
            }
        });
        curLoadedPopup.isOpen= true;
        curbmPopup = this.dropDown;
        curLoadedPopup = this.dropDown;
      }
    },
    loadBaseMaps: function (jsonpath, node)
    {
        dojo.xhrGet(
        {
            url: jsonpath,
            load: function (response)
            {
                node.BMHtml = "";
                node.countmaps = 0;
                dojo.forEach(response.basemaps, function (entry, index, array)
                {
                    node.BMHtml += '<div id="bm_' + entry.id + '" style=" border:2px solid white; font-size:10px;width :54px;padding:3px; position:relative; float:left; cursor:pointer;" onclick="curbmPopup.containernode.setBaseMap(\'' + entry.URL + '\', \'' + entry.id + '\' , \'' + entry.name + '\' , \'' + entry.type + '\' , \'' + entry.copyright + '\', curbmPopup.containernode.map) ;">  <img width=55 src="' + entry.swatchURL + '"/><center>' + entry.name + '</center></div>';
                    node.countmaps++;
                });

                try
                {
                    dojo.query('#bm_' + curbmPopup.containernode.map.basemap.id)[0].style.border = "2px solid gray"
                }
                catch (e)
                {
                }

                response = null;
                return response;
            },
            error: function (response, ioArgs)
            {
                response = null;
                return response;
            },
            handleAs: "json"
        });

        //this.basemapConfig = this.map.dcc.getJson(jsonpath);

        //return this.basemapConfig;
    },



setBaseMap: function (url, id, name, type, copyright, themap)
 {
  if (typeof themap.basemap == 'undefined')
  {
    this.basemapName = themap._layers[themap.layerIds[0]].id;
    themap.basemap = themap._layers[themap.layerIds[0]];


  }

  if (this.basemapName != name) //if map has changed
  {
   this.basemapId = id;
   this.basemapName = name;
   this.basemapType = type;
   this.url = url;
   this.copyright = copyright;


   // clear highlighted services
   try
   {
    dojo.query('#bm_' + curbmPopup.containernode.map.basemap.id)[0].style.border = "2px solid white"
   }
   catch (e)
   {
   }

   try
   {
    themap.removeLayer(themap.basemap);
   }
   catch (e)
   {
    themap.removeLayer(themap.basemap);
   }
   if (this.basemapType == "ArcGISDynamicMapServiceLayer")
   {
    themap.basemap = new esri.layers.ArcGISDynamicMapServiceLayer(this.url, {
     transparent: true,
     id: id
    });
   }
   else if (this.basemapType == "ArcGISTiledMapServiceLayer")
   {
    themap.basemap = new esri.layers.ArcGISTiledMapServiceLayer(this.url, {
     id: id
    });

   }

   themap.basemap = themap.addLayer(themap.basemap, 0);
   myLayers[0].Layer= themap.basemap;
   myLayers[0].Label = id;
   themap.basemap.url = url;
   themap.basemap.id = id;

   // themap.dcc.layers.basemap.id = id;
   dojo.byId("Copyright").innerHTML = this.copyright;


   //highlight mapservice
   try
   {
    dojo.query('#bm_' + curbmPopup.containernode.map.basemap.id)[0].style.border = "2px solid gray"
   }
   catch (e)
   {
   }

  }
 }

 });

0 Kudos
PaulFreeman
New Contributor
Problem solved, there was a link to the old CSS in an include file, updating this to 2.8 worked.

thanks for looking:)
0 Kudos