Select to view content in your preferred language

How to add custom link or button in info window and get the event in arcgis web appbuilder?

6671
15
Jump to solution
07-31-2016 09:53 PM
ShaikhRizuan
Regular Contributor


Hi,

I want to add a link or button in info window like "ZoomIn" after Search done from search widget and get the button event in the widget.js of search widget in ArcGIS web AppBuilder.

Also i have attached the screenshot for better understanding of the requirement (highlighted in red color).

Any suggestions or code??

Regards,

Shaikh Rizuan

0 Kudos
15 Replies
by Anonymous User
Not applicable

slick, I'll have to come to this.  For now, to do links to our Tax Cards which have a unique number (primary key) in the URL I put that in as a link http://thelink/{PropertyNumber}  for a Picture in the bottom of the popup. I did a screenshot of the word "Tax Card" with a button as a background, put it in, works like a charm.

0 Kudos
RichBell
Regular Contributor

Nice!

Help Please????

I'm not as savoy as to how to do this. Could someone show the completed addition of the example code in the Search widget.js and if there are any other files that need to be edited? I would really like to do this too!.....

Rich

0 Kudos
by Anonymous User
Not applicable

I put the links in the popup in the Configure Popup in ArcGIS Online.

Just create a picture, put it in a specific spot in WAB and put this path in for the URL to the Picture. Maybe a picture of the word "Site Plan" or something. (instead of Tax Card in our case)

Then, put in a description (optional) and for the link, the first part of it like http://yoursite.com/files/{PDFfilepath}

The {PDFfilepath} in brackets would be a filename, for files in a folder full of PDF files, for example, on your server.  This would be assuming you had a field in your layer like 'filepath' that contained the filename. ThePDFfilepath therefore takes the value of whatever the layer has in that field for that record. Savvy matey?   Just let me know if this helps shed more light on it for you.

0 Kudos
RichBell
Regular Contributor

Thanks, but not quite what I was looking for.

More specifically is where and how do I insert this snippet of code from the last post into the search Widget.js?

A screen shot of a working widget with this code inserted would be great.

Rich

Picture0002.jpg

0 Kudos
MarkTurnbull
Regular Contributor

Answer looks like a good solution, but if I wanted these actions to appear in the default map callout (not the search widget callout), where would I add this code? Is this code relevant for the default map callout?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mark,

https://developers.arcgis.com/web-appbuilder/sample-code/create-a-feature-action-in-your-widget.htm

   To have an action appear in the map default popup you can add the feature action to the jimu.js\featureActions folder and add a reference to your featureAction to the main.js

0 Kudos