Select to view content in your preferred language

getAllJimuLayerViews() method not recognize in Experience Builder App on Portal

232
6
Jump to solution
08-05-2024 01:32 AM
DiegoSatian
New Contributor II

Hello community,

I continue working in the development of custom widgets for Experience Builder and I would like to have some help with a problem that came up.

Basically, the custom widget will ask three different layers from a map widget on ExB App within Portal 11.1 to perform later some different actions. In the 'Setting' code, a Map Widget Selector is used to define the map source from which the layers will be taken. Meanwhile, into the 'Widget' code the JimuMapViewComponent is implemented to pass the selected Jimu Map View and perform a query selection of the features that intersect the map view extent.

The problem shows-up just when I deployed the widget into my ExB App into my Portal and it shows the message that can be seen in Image 1. But when I am working with the builder (development environment) this problem does not show-up and the query action is performed successfully.

 DiegoSatian_0-1722846332829.png

Image 1. Error showed by ExB App on Portal.

Attached to this message please find the 'Settings' and 'Widget' scripts. I hope someone can help me or recommend me some sources where I can have a better understanding of this problem. I have searched the solution but I did not have luck with it.

I am working with Experience Builder Developer 1.14 and publish the custom widget into ArcGIS Portal in Enterprise 11.1.

Thanks in advance!

Diego

 

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Note that ArcGIS Enterprise 11.1 uses Experience Builder 1.10. Since the API Reference page only contains the current version, you'd have to download the documentation to see if the JimuMapView class contains the getAllJimuLayerViews method for that version.

**Update**

That method first shows up in the index.js file in D:\ExperienceBuilder\ArcGISExperienceBuilder_114\client\dist\jimu-arcgis. The method isn't found in previous versions. It would be quite helpful if they would include the version that classes and methods were introduced, like they do in the ArcGIS Maps SDK for JavaScript API reference. I've added as an Idea for this.

 

View solution in original post

6 Replies
TimWestern
Occasional Contributor II

so I had to look up promiseUtils because I hadn't heard of that one.  Its defined over here in the ArcGIS Maps SDK for JavaScript 4.2 

https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html


Now (this appears to be a left over from the ArcMap JS API, which may or may not be deprecated I'm not sure)

But it struck me as odd that Promise Layers does not appear to be labeled as Async, and I wondered if that could be part of what is going on here.

You do use .then syntax with promiseUtils which is one of the ways to handle that, so I'm not sure, but I don't even know that its getting to promiseUtils because of the error on that method

So I checked and it looks like getAllJimuLayerViews is there in EXB

https://developers.arcgis.com/experience-builder/api-reference/jimu-arcgis/JimuMapView/ 

 

and you do have that in the import for JimuMapView which it is on.   
You could try separating the mapview into a separate constant then try calling it, because I wonder if when called it is sometimes getting null.  and of course null would not have that method.






DiegoSatian
New Contributor II

Hi Tim, thanks for your comments and ideas. 🖖

0 Kudos
KenBuja
MVP Esteemed Contributor

Note that ArcGIS Enterprise 11.1 uses Experience Builder 1.10. Since the API Reference page only contains the current version, you'd have to download the documentation to see if the JimuMapView class contains the getAllJimuLayerViews method for that version.

**Update**

That method first shows up in the index.js file in D:\ExperienceBuilder\ArcGISExperienceBuilder_114\client\dist\jimu-arcgis. The method isn't found in previous versions. It would be quite helpful if they would include the version that classes and methods were introduced, like they do in the ArcGIS Maps SDK for JavaScript API reference. I've added as an Idea for this.

 

DiegoSatian
New Contributor II

Hi Ken, thank you very much for your comments and analysis. I could solve the problem and you were right, I just changed the method and use a new way to access my layers according to ExB 1.10. Now my widget is working into my ExB App on my Portal.

Thanks for rise-up the idea to ESRI it would be very helpful to have this info on our hands.

Greetings,

Diego

TimWestern
Occasional Contributor II

Yeah Ideally they should have notes for:

What version it was added in, and if its retired what was the last version it was in.

I would find this particularly confusing, if I'd had a lot more WebApp Builder experience with the older JS APIs before Experience Builder, as EXB is still not a 1 to 1 comparison in terms of available features in some respectes.

0 Kudos
KenBuja
MVP Esteemed Contributor

If you like the idea, please Kudo it so it gets more visibility and a higher priority for fixing.

0 Kudos