Select to view content in your preferred language

BuildingComponentSublayer popupTemplate action displays error

511
4
02-24-2023 03:34 AM
ChristopheS
New Contributor II

Hi All,

when trying to add a custom button to the default popup of a BuildingSceneLayer, I get this message inside the popup :

"The information for this feature could not be displayed."

The original ESRI sample  is here : https://developers.arcgis.com/javascript/latest/sample-code/building-scene-layer-slice/  is shows the list of fields values in a table.

And the customized codepen that should have my custom button in its popup AND the list of all fields in a table:

https://codepen.io/Chris_Siveco/pen/RwYGbRZ 

The aim is to have the default table array displayed with my custom button close to the "zoom to" button.

Regards, Chris

0 Kudos
4 Replies
GreteSoosalu
Esri Contributor

Hi @ChristopheS 
I'm looking into it and notice that the error only appears for me if the outFields:["*"] property is used while creating the PopupTemplate.

Could you try if it works for your purpose when you comment the rows number 82 and 123 out? 

PS I'll investigate further to see what exacty is happening. 

ChristopheS
New Contributor II

Hi @GreteSoosalu ,

when commenting out lines 82 and 123, there no error anymore, but also there are no table showing either. What I wish is to have both my action button and the table of the fields values.

 

0 Kudos
GreteSoosalu
Esri Contributor

Thanks for your patience! We're still looking into it to see whether there is a problem with this data.

Meanwhile - is your goal to show a subset of the field values or a table with all of them? 

In case of the former, you can list the fields one by one under popupTemplate.content.

Or, in case of the latter, you could use the layer.createPopupTemplate method to apply the default template and add the custom button to it afterwards: 

 

// Use the default template for the layer:
layer.createPopupTemplate();
// Add the custom action button to it:
// Note: as the popup template isn't available right away, we need to wait a bit. 
layer.when(() => {
  layer.popupTemplate.actions = [bimTemplateAction];
});

 

See this app for reference: https://codepen.io/gsoosalu/pen/NWLdLpq 

Note that the outFields property only defines which fields need to be available (i.e. loaded from a service) before rendering of the popup. But it doesn't automatically provide the table with all the fields. 

0 Kudos
ChristopheS
New Contributor II

Thank you for your answer.

It is fine for me, thanks to you I could manage to have the whole table displayed with my custom action added, and then process a click to the action.

Regards,

Chris

0 Kudos