costume widget not loading

262
9
Jump to solution
05-21-2019 03:41 AM
deleted-user-wcpelUUf_XXx
New Contributor III

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:

ArcGIS Web Application 

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

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.

View solution in original post

9 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

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.

deleted-user-wcpelUUf_XXx
New Contributor III

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?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Segev,

You can NOT use a custom Web App Builder widget inside a vanilla JS API application.

deleted-user-wcpelUUf_XXx
New Contributor III
0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

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.

deleted-user-wcpelUUf_XXx
New Contributor III

OK so I found this for the js vanilla api:

https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#development-requireme...

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.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

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.

https://developers.arcgis.com/web-appbuilder/

deleted-user-wcpelUUf_XXx
New Contributor III

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

my WAB

here is my widget on the WAB i can see and add it

widget on WAB

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

the problem

If i am wrong about this sorry i wasted so much of your time I am trying.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

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.

View solution in original post