Popup has two titles

1639
11
08-01-2012 12:29 PM
by Anonymous User
Not applicable
I have a popup window that displays the title twice. I really want to use the title field but it looks really weird as is. I have tried pulling from an attribute field as well as inputting plain text for the title. Anyone have any ideas??
     


   
    var popup = new esri.dijit.Popup(null, dojo.create("div"));
 
    map = new esri.Map("map", {
        extent: initExtent,
        infoWindow:popup
    });



          //define a popup template
       popupTemplate = new esri.dijit.PopupTemplate({
          title: "INCIDENT",
          fieldInfos: [
          {fieldName: "DESCRIPTION",label:"DESCRIPTION", visible: true},
          {fieldName: "ADDRESS", label:"LOCATION", visible: true},
          {fieldName: "START_DATE", label:"DATE", visible:true ,format:{dateFormat:'shortDate'}}
          ]
        });


    featureLayer = new esri.layers.FeatureLayer("http://gis6.midland-mi.org/ArcGIS/rest/services/PublicSafety/MapServer/0", {
        mode: esri.layers.FeatureLayer.MODE_SELECTION,
        outFields:["*"],
        infoTemplate: popupTemplate
    });
0 Kudos
11 Replies
StephenLead
Regular Contributor III
Hi Dan,

Have you followed the steps listed on the Working With Popups page?

There may be something amiss with your CSS which is causing the title to appear twice. Can you post a link to the live page?

Steve
0 Kudos
AdamWills
New Contributor II
I'm having this issue as well....

This is my PopupTemplate...

    
var popupTemplate = new esri.dijit.PopupTemplate({
          title: "{NAME}",
          fieldInfos: [
           {fieldName: "ADDRESS", visible: true, label:"Address:"},
           {fieldName: "TELEPHONE", visible:true, label:"Phone:"}
          ]
    });
0 Kudos
KellyHutchins
Esri Frequent Contributor
The Popup info window was designed to display navigation info in the header. For example if you've selected multiple features it will show 1 of 2 with nav arrows. In cases where you are associating the popup with a clicked feature  - like in the sample below you will see the title in the top bar of the popup and also at the top of the popup's content section.

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/fl_featurecoll...

You can hide the title in the content using the following css:

      .esriViewPopup .header {
        display:none;
      }
      .esriViewPopup .hzLine{
        display:none;
      }

0 Kudos
DerekMiller
New Contributor III
The Popup info window was designed to display navigation info in the header. For example if you've selected multiple features it will show 1 of 2 with nav arrows. In cases where you are associating the popup with a clicked feature  - like in the sample below you will see the title in the top bar of the popup and also at the top of the popup's content section.

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/fl_featurecoll...

You can hide the title in the content using the following css:

      .esriViewPopup .header {
        display:none;
      }
      .esriViewPopup .hzLine{
        display:none;
      }



Hi Kelly... what if you'd rather remove the title from the header section? I understand that the 'default' popup functionality is to show navigation in the header with the title in the content, but in my experience this is not the case. I've been able to implement your solution above, but I would prefer the opposite.

See what I mean here: http://www.portlandbps.com/gis/beResourceful/index.html

I can post code if necessary as well.

Thanks,

- d
0 Kudos
KellyHutchins
Esri Frequent Contributor
Derek,

I took a look at your site (nice app by the way) and I'm not sure what you are trying to do? Sounds like you want the title in the header - which you have accomplished.  Did you want to have both nav and the header?



Hi Kelly... what if you'd rather remove the title from the header section? I understand that the 'default' popup functionality is to show navigation in the header with the title in the content, but in my experience this is not the case. I've been able to implement your solution above, but I would prefer the opposite.

See what I mean here: http://www.portlandbps.com/gis/beResourceful/index.html

I can post code if necessary as well.

Thanks,

- d
0 Kudos
DerekMiller
New Contributor III
Thanks, Kelly. Apologies for the confusion.

I'd like to put the title back into the content pane (in a new app I'm working on... beResourceful was an example).

I can do that by undoing the modifications to the css (think it was .hz line & .header in the css).

I cannot, however, prevent the popup from displaying the title in place of the nav info... which doesn't make any sense and has me confused.

Thoughts? Thanks again.

- derek
0 Kudos
StephenLead
Regular Contributor III
I cannot, however, prevent the popup from displaying the title in place of the nav info


You could over-write the popup's title with a blank string using something like:

map.infoWindow.setTitle("")


Steve
0 Kudos
DerekMiller
New Contributor III
Thanks, Stephen. You're correct, that will overwrite the popup title. However, I'm still not seeing the navigation info, with or without a title set. Anyone having this issue with popups?

Side note: I am NOT creating the map or popups through arcgisonline, but rather with the popupTemplate configuration parameters.

Thanks again for the thoughts.
0 Kudos
KellyHutchins
Esri Frequent Contributor
The navigation info is displayed when you use popup.setFeatures to associate one or more features with the popup. So if you don't use setFeatures you'll only see one feature at a time.
0 Kudos