Select to view content in your preferred language

Download WAP application downloads old Custom Widget code.

35495
7
Jump to solution
02-22-2017 05:27 AM
DavidWendelken
Frequent Contributor

I went thru the Esri tutorial to make a demo widget, MyWidget.  I tested it and it worked.
I moved it to the main widget directory and assigned it to a map. It worked.
I downloaded the map and installed the downloaded application on my gis web sever.  It worked.

I then added a new function and tidied up the console messages in the widget.js file.

I downloaded the map but only the old widget.js file shows up.  It's as if the changes were never made.


What am I doing wrong?  

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

David,

   The app # is easy to see in the url that is used when you are working with the app in WAB. Once a widget is added to the app a COPY of the widget from the stemapp widget folder is made at that moment and now any changes you make to the stemapp widget folder is no longer reflected in that app. You need to make all your code modification in the apps widgets folder.

You should delete the contents of the [install dir]\server\apps\zips folder to make sure when you download the app again you are actually getting the latest code.

View solution in original post

7 Replies
RobertScheitlin__GISP
MVP Emeritus

David,


  When you made your code changes did you make them to the Widget in the stemapp folder or the one in the particular [instal dir]/server/apps/[app #]/widgets folder?

DavidWendelken
Frequent Contributor

stemapp.  

0 Kudos
DavidWendelken
Frequent Contributor

Hmmm.   There used to be just 3 directories in the  [instal dir]/server/apps/[app #]/widgets folder.  A zips directory that held 2.zip and 3.zip and a 2 and 3 directory.  I had assumed that the 2 and 3 represented 2d and 3d. 

But based on your comment the 2 and 3 are app numbers, not 2d and 3d.   I now have a 4 directory (but no 4.zip).  I had created a new web map but had not downloaded it yet.   I just downloaded it and the 4.zip showed up.

First, if I open up the #.zip file and read the appinfo.json file I can figure out which number goes with which app.  
Is there a quicker, easier way?

The app in question is #3.

Second, I copied MyWidget code to the [instal dir]/server/apps/[app #]/widgets folder and replaced the prior version.
I then downloaded the application again.  The old widget code was downloaded and it's still in 3.zip also. 

I am clearly missing something.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

David,

   The app # is easy to see in the url that is used when you are working with the app in WAB. Once a widget is added to the app a COPY of the widget from the stemapp widget folder is made at that moment and now any changes you make to the stemapp widget folder is no longer reflected in that app. You need to make all your code modification in the apps widgets folder.

You should delete the contents of the [install dir]\server\apps\zips folder to make sure when you download the app again you are actually getting the latest code.

DavidWendelken
Frequent Contributor

Ok, If I get rid of 3.zip and download the application again, it will build a new 3.zip with the correct widget code in it and the download code will be correct also.

I'm going to have to do more experiments to get a cleaner workflow that's less prone to forgetting a step.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

David,

When developing new custom widgets the widget/theme development work flow I use for all my work is this.

1. Copy the [install dir]\client\stemapp\widgets\samplewidgets\CustomWidgetTemplate folder to the stemapp widget folder and rename it to your custom widgets name.
2. Open the manifest.json and change the name property to the exact name of the widget folder from step one.
3. I now work on changing the icon and some basics of the widget.
4. Now I create a new app (normally the app will be named the same as my custom widgets name) and will see that my new custom widget is a choice in the widget choices.
5. Add my custom widget to the new app.
6. Now I do ALL my development in the [install dir]\server\apps\[app #]\widgets\my custom widget name folder.
7. Once I am done will my development I copy the widget folder back into the stemapp widgets folder so that new apps will use the completed widget code.

DavidWendelken
Frequent Contributor

I want to thank you again for the workflow you provided above.  It has been very helpful.

I do want to make a recommendation, though.

On two different occasions the map I'm working on has deleted the custom widgets that are in the application.  On one of those occasions it's also forgotten what map is being used by the application.

I know the last time the problem showed up shortly after I saved the application.   I assume that is related to the problem, but cannot swear to it.

This isn't a case of "save your files frequently and often".   This is a case of "make sure the widget files are copied out of the application directory anytime you've made a change you don't want to make again."

Thankfully, I've only lost a few hours to this.



0 Kudos