I am trying to build a simple widget that adds and delete a heatmap.
I started a costume widget adding html(why are there two html files(widget and widget html)) css and js
and can add it to a web application (not loading i assume because my code is faulty)
heres a codepen for the widget:
https://codepen.io/segev-salman/pen/EzbxBP
here is the webmap if its relevent:
Solved! Go to Solution.
Segev,
OK, now I understand. But you still have a lot to learn. WAB 2D apps use the 3.x JS API and you are attempting to use the 4.x API and you can not do that.
Segev,
You can Not use a custom Web App Builder widget inside a vanilla JS API application. WAB Widgets are dependent on Many other files in the WAB application and the jimu framework.
Robert,
I am not sure if you understand, I am not trying to use it inside a vanilla JS i just used the codepen to display my code.
I downloaded the app and following the api guide to use a costume widget. all the files in here are copied from a new simple widget folder that i added to my "arcgis-web-appbuilder- 2.12\WebAppBuilderForArcGIS\client\stemapp\widgets" folder the widget is appearing in the web app builder when I add a widget but when i open it it doesn't load.
if you did understand and I am wrong could you please direct me to what am i missing?
Segev,
You can NOT use a custom Web App Builder widget inside a vanilla JS API application.
Robert.
sorry for being dense, but is this not vanilla js?
https://developers.arcgis.com/web-appbuilder/sample-code/create-custom-in-panel-widget.htm
Segev,
You are trying to add a WAB widget into a JS API 4.11 app (vanilla js api app). You can not do that.
OK so I found this for the js vanilla api:
so just to be sure, where can i add my WAB widget to?
again sorry for not understanding I built the app with the WAB so I assumed that I can add it.
Segev,
The codepen you linked has nothing to do with a WAB app. WAB widget can only be added to an app that is built using Web App Builder.
Robert,
I might have badly communicated so this is what i actually did , you say I am using a WAB widget and that it could only be to an WAB app and thats what i did.
so this is my widget file in the WAB
this is my WAB
here is my widget on the WAB i can see and add it
here is the problem i think it doesn't work because of my code and i am not sure how to display all those files so i made the code pen i am not expecting the codepen to work
If i am wrong about this sorry i wasted so much of your time I am trying.
Segev,
OK, now I understand. But you still have a lot to learn. WAB 2D apps use the 3.x JS API and you are attempting to use the 4.x API and you can not do that.