Select to view content in your preferred language

How to configure code to remove panels in WAB screening widget ?

1538
6
11-17-2017 01:44 PM
CharlesBailey3
Frequent Contributor

Hello, I'm at my wits end trying to make some 'simple' revisions to the new screening widget in WAB 2.6. All I want to do is remove some of the panels in the widget so that it just allows selecting a layer and outputs the area and length for each selected feature. I don't want the user to be able to buffer, pick selection layers, print, or download and I want to remove the composite AOI area which only includes some of the layers and is confusing and unnecessary. See attached screenshots for further explanation. My ignorance here is quite embarrassing - don't want to say how long I've spent on this... thanks, cob

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Cob,

  Here is a css rule you can add to the very bottom of the widgets css\style.css file:

.esriCTWidgetAndBufferSeparator,
.esriCTExpandCollapseParentContainer,
.esriCTAOIBufferChangeParentContainer,
.esriCTBufferDistanceLabelTextBoxContainer {
  display: none;
}

I am not familiar at all with this widget so I am not sure about your second screenshot.

JessicaNeuner
Regular Contributor

Hi Charles, 

I'm wondering if there's possibly an easier way to address the workflow need you have -- as i understand it, you want users to be able to select features from the map and then get a list of the features that includes the feature area or length?  I've got two ideas for you:

(1) If the area and length of the features is calculated in an attribute on the feature layer, you could do this with the Select widget... 

After making a feature selection, click the ellipses and available feature actions will be presented. One of them is View in Attribute Table. This would present a tabular view of the data, including the pre-calculated areas.

Show selection in attribute table

(2) if it's not possible to modify the data to include the area and shape values, then I'd recommend extending the Select widget by adding a feature action that could show up in the list to perform the analysis required.   The reason why this may be better given what I understand of your workflow is that the Screening widget is designed to actually clip the features based on the AOI defined (in your case a selection set) -- and that is the area or length that is reported; it may not be the full length or area of the intersecting features.

CharlesBailey3
Frequent Contributor

Are you saying that if I set the AOI extent to only include part of a feature, only that part will be measured? It doesn't seem to be working that way - if any part of the feature is in the AOI then the whole feature is selected and measured. We don't have the areas and lengths in the table - that's what we're trying to calculate. The Screening would just allow the user to manually add the calculations to the feature tables. It would be ideal if the calcs were added to the table and automatically updated with each edit, but we've literally spent years trying to figure that one out. I did look at the feature actions demo but really lost at the 'Use the feature action' part - where does the featureactionmanager code go and how does it get into the UI? Thanks, cob

0 Kudos
JessicaNeuner
Regular Contributor

Hi Cob -- 

I'll see if I can find a developer to weigh on implementing Feature Actions, it's not my forte.

Unless you've removed the logic that does the clip analysis when clicking the 'Report' button - then the layers that have been configured for reporting are being clipped by the area of interest -- which in your case is based on a selection -- and if only the selected layer is configured for analysis, then yes - I would expect you are getting the entire are of the features reported in the panel. 

Jess

0 Kudos
CharlesBailey3
Frequent Contributor

Well it works, and we've actually been using it - for polygons. I can't get it to measure lines unless the line happens to be inside a polygon. It makes the selection on the line features but shows 'N/A" in the length field in the panel. So another setback - unbelievable how difficult it is to measure existing features in the web apps. Who wants to do that, right? Thanks, cob

0 Kudos
JessicaNeuner
Regular Contributor

This could be related to the way in which the line features are identified.  There are essentially two different workflows within the widget --- one that does a clip and one that does a select by location.  If the Select by location workflow is followed (with the released version of the widget this would happen with Point or Line AOIs that do not have a buffer), then the length and area are not reported since the intention is to report the amount (length, area, count) or the features within the defined area. 

0 Kudos