Select to view content in your preferred language

Overwriting of init.js files in Portal for ArcGIS regarding custom widgets for WAB

1103
2
09-03-2021 02:31 AM
JanSarata
Esri Contributor

Dears,

we developed some custom widgets for WebApp Builder where we used 3rd party libs so we had to change the init.js file to load these libs.

Then we deployed our custom widgets to the customer's Portal so we had to modified the init.js file within the Portal installation accordingly. Now the customer has problem that after every restart of Portal for ArcGIS service the init.js file restore to its default form without our modifications. Of course, the widgets then stop working since they lack 3rd party libs from init.js.
My questions are: Why is this happening? Can I somehow prevent Portal to overwriting init.js?

It includes these init.js at these locations:
<Portal installation folder>\Portal\apps\webappviewer\init.js
<Portal installation folder>\Portal\apps\webappbuilder\stemapp\init.js

Appreciate any help,

Jan

0 Kudos
2 Replies
LefterisKoumis
Frequent Contributor

No.if you want to create custom widgets use the developer's version of WAB and deploy it on your web server.

0 Kudos
JanSarata
Esri Contributor

Hi @LefterisKoumis ,

thanks for your reply, however there is documented way how to deploy custom widgets to Portal:

https://community.esri.com/t5/arcgis-web-appbuilder-questions/overwriting-of-init-js-files-in-portal...

There is also docuemnted way how to use 3rd party libs (edit init.js file):

https://developers.arcgis.com/web-appbuilder/sample-code/add-a-third-party-library.htm

But obviously we can't compose these two approaches to deploy custom widget with 3rd party library on Portal for ArcGIS.

Jan

0 Kudos