Select to view content in your preferred language

Custom Widget used in WAB needs help and fixing

499
2
Jump to solution
03-12-2024 07:29 AM
Labels (1)
JamieMorris_SNG
Emerging Contributor

Hello Community, 

I am hoping someone might be able to provide some help on this one. It has been rumbling on for over 3 months, We have a custom widget deployed before my time that basically drew a T in polyline at a pre defined length. this was linked to a feature layer (hosted) that allowed multiple users edit data. 

I made some changes and essentially created a new hosted feature layer and deployed but the custom widget cannot reference this layer and when looking within a portal WAB it says that the map does not contain a specific layer - even though the layer is within the application, It is editable. and the records sync with the feature class within the geodatabase sitting inside the sde. 
essentially the original widget code has not changed in any way so i cannot understand why it no longer works when all we have done is create a new hosted feature layer with additional fields available to add data into. 

The original source code cannot be found at esri as it was developed a number of years ago. Is there anyone that might be able to help either in the coding of the widget to see if it is correct or missing something. and also might be able to help me understand why the widget itself cannot find the editable layer that is clearly showing inside the web map and web application. 

JamieMorris_SNG_0-1710249688438.png

this shows the widget saying it does not contain a layer. 

JamieMorris_SNG_1-1710249731911.png

this shows the hosted feature layer within the web app test build

JamieMorris_SNG_2-1710250195417.png

this shows it within a web map and able to edit manually and draw lines, but the widget would when selected draw a pre defined shape on the map using the fields we have in the table rather than having non uniform lengths and incorrect data. 

 

When we combine the map, the widget together it doesnt work and the widget cannot find the layer and carry out the specific actions we want it to. 

i have had to blank out some information from the image just to ensure it is not breaching anything but in desperate need of help on this one.. 

1 Solution

Accepted Solutions
JamieMorris_SNG
Emerging Contributor

issue fixed with the help of ESRI professional Services, there was two symbols required on one line of code to allow the widget to find a hosted feature layer rather than a feature layer. 

 

View solution in original post

0 Kudos
2 Replies
JamieMorris_SNG
Emerging Contributor

to follow up on this one.. I have reverted back to the original WAB 2.1 build we had installed and deployed in our portal.. to which the TMark layer in question now shows on the widget however when clicking on the map as outlined - nothing comes through and shows on the map.. 
we are getting a 404 error when looking the developer code itself and the array for the widget shows the correct order in the code:

createToolbar: function (themap) {
 
this.toolbar = new Draw(this.map);
this.toolbar.on("draw-end", lang.hitch(this, this.addToMap));
 
this.editToolbar = new Edit(this.map);
 
var layerIds = this.map.graphicsLayerIds;
console.log('TMarks edit layers', layerIds);
                        //set layerIDs [index] to match the T-mark layer index from the list
                        //same as in Chrome F12 > Developer Window > Console Tab
this.tMarkLayer = this.map.getLayer(layerIds[3]);
404 error comes up on the following link: https:*************************/portal_widgets/t_mark/Widget but i can point to it inside of IIS and see the html pages come up correctly? 
am i missing something here and can anyone shed any light on this please. 
 
0 Kudos
JamieMorris_SNG
Emerging Contributor

issue fixed with the help of ESRI professional Services, there was two symbols required on one line of code to allow the widget to find a hosted feature layer rather than a feature layer. 

 

0 Kudos