PopupTemplate title vanishing

609
5
03-25-2020 02:50 PM
TylerLawson
New Contributor III

I have been in the process of updating an application from 4.6 to 4.14 and have noticed something weird happening with my popup templates. Whenever I click on a feature, it opens the popup but the title briefly appears before vanishing. It doesn't seem to be related to the features, featureLayer, or renderer as I created test objects of each and it acts the same.


Picture of blank title:

Code for feature:
var testFeatures = [];
var feature = {
Id: "Test",
geometry: new Point({
x: -96.8107,
y: 33.1509
}),
attributes: {
Name: "Test",
ObjectID: 1
}
};
testFeatures.push(feature);

FeatureLayer:
var lyrTest = new FeatureLayer({
// create an instance of esri/layers/support/Field for each field object
fields: [
{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
},
{
name: "Type",
alias: "Type",
type: "string"
} ,
{
name: "Name",
alias: "Name",
type: "string"
}
],
objectIdField: "ObjectID",
geometryType: "point",
spatialReference: { wkid: 4326 },
source: testFeatures,
labelsVisible: true,
renderer: testRenderer,
id: "TestLayer"
});
lyrTest.popupTemplate = templateTest;
map.add(lyrTest);

Renderer:
var testRenderer = {
type: "unique-value",
field: "Name",
uniqueValueInfos: [
{
value: "Test",
symbol: new SimpleMarkerSymbol({
color: "blue",
outline: {
color: "blue",
width: 1
}
}),
label: "Test"
}
]
};

PopupTemplate:
var templateTest = {
title: "Test Title",
outFields: ["*"],
content: "This is a test"
};

Any suggestions as to what could be going on would be appreciated.

Tags (1)
0 Kudos
5 Replies
Egge-Jan_Pollé
MVP Regular Contributor

Hi Tyler Lawson,

This sounds weird. It is not the normal behavior. If you check the Intro to PopupTemplate in the sandbox, which you have surely done, you will see the normal behavior is for the title to appear and to stay. I tested this in my favorite browser (Firefox), but it also runs in Internet Explorer.

So, we've got to find out where your application deviates from the functionality in this sample...

  • Can you share an application (i.e. in CodePen) to show the issue in real-time?
  • What browser or browsers are you using? Only modern ones, I hope 🙂

HTH,

Egge-Jan

0 Kudos
TylerLawson
New Contributor III

Egge,

I am currently testing on the latest version of chrome. I have gone through all of the sample applications in the same browser and they seem to work as intended, so it doesn't seem to be a browser issue.

The main differences I can see in my application are that I am using multiple featureLayers populated  by client-side graphics and I am using a downloaded version of the SDK due to incompatibility with Durandal. This does make sharing any representative test application somewhat difficult.

Do you know of any outstanding issues regarding the downloaded SDK or any other functionality that could act as a work-around for displaying information?

Sincerely,

Tyler Lawson

Egge-Jan_Pollé
MVP Regular Contributor

Hi Tyler Lawson,

Please note: I am not from Esri. Just another user who tries to think with you to solve the issue... 🙂 And the discussion is open to others to jump in with ideas and suggestions.

Thank you for the additional information about your particular setup. My hypothesis was that it is not a bug in the ArcGIS API for JavaScript version 4.14 as such, as it seams to work under 'normal' circumstances. So, something else is causing the problem in your case...

  • You are talking about Durandal, is that this Durandal? Could that be causing the issue?
  • Can you confirm that the 4.6 version of your application does work correctly in combination with Durandal, or are you introducing Durandal just now for the new version?
  • Any (error) messages in your console?
  • ...

Please let us know.

Cheers,

Egge-Jan

0 Kudos
TylerLawson
New Contributor III

Thanks for your input. That is the Durandal that we are using, and it functioned as intended in the 4.6 version. I can go back and confirm that it was working correctly but I didn't notice any weird behavior until updating to 4.14, which is why I thought there might be some weird interplay with the downloaded SDK and Durandal. 

Also there doesn't seem to be any errors in the console that are thrown.

Egge-Jan_Pollé
MVP Regular Contributor

Hmmm, let's see. Maybe others have any suggestions..?

0 Kudos