Custom Widget - BaseFeatureAction Type Functionality in Experience Builder?

119
1
11-29-2021 12:29 PM
JonathanKressin
New Contributor

I am currently working at rewriting Widgets that were written in WebAppBuilder to similar functionality in ExperienceBuilder.  One of the components I utilized in WAB was the BaseFeatureAction item.  That way, when a parcel was clicked, there were a number of different processes a user could select from the identification window.  Has anyone found a way to reproduce this in Experience Builder?  Or if not that specifically, is there a way to add other tools besides 'Zoom To' to the feature popup box?  

Any suggestions on best approaches to do something similar with this application would be appreciated.

 

Thanks!

Jonathan Kressin

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

@JonathanKressin 

I did it this way. In my custom widget that produces search results I add an action button to the popup template for the results featurelayer.

    let AssessReportAB = new ActionButton({
      title: "Assessment Report",
      id: "taxReport",
      image: require("./assets/Report-dark.svg")
    });
...

    let popUpInfo = {
      title: '{' + titleField + '}',
      content: this.getPTcontent,
      outFields: ["*"],
      actions: [AssessReportAB,taxBillAB,impReportAB,CoordReportAB]
    };
    var pt = new PopupTemplate(popUpInfo);

...

jimuMapView.view.popup.viewModel.on("trigger-action", function(event) {
        if(that.props.state === WidgetState.Opened){
          if (event.action.id === "taxReport") {
            let attributes = jimuMapView.view.popup.viewModel.selectedFeature.attributes;
            this.showTaxReport(attributes.PPIN, this.currentLayerAdded);
          }

 of course this route does not add the actions to any popup that appears in the app but that is actually exactly what I want in my scenario.

0 Kudos