Errors in Create a ListView widget --WAB Sample Code--?

1624
8
Jump to solution
09-06-2017 12:46 PM
FrancescoTonini2
Occasional Contributor II

I am following line by line the setup of a custom ListView widget from the official ESRI sample code page:

Create a ListView widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers 

  • Under "Create a Widget Folder Structure": 

               ...

               4)  Register the widget in the list.json at path/to/WAB/client/stemapp/widgets.

              ...

 

               Is this list.json an error? There is NO such file inside ~client/stemapp or ~client/stemapp/widgets. Beside, do I                really have to "register" the widget? In order for it to be available to WAB, I thought it simply needs to be                copy/pasted into ~client/stemapp/widgets...

 

  • When adding the widget to a new Web App (2D), I click to add my ListView widget (+ sign), but it shows with name "Demo". This would make sense if my folder and baseClass were named "Demo", but as you can see (attached zip folder) there is NO "Demo" word left in any of the files...any idea why this happens?

  • Finally, the settings page should show something like this: 

but after copy/pasting the same code in the settings.js and settings.html, in my case it shows like this:

The list should be populated...This is strange since I have my operational layer saved and added in the web map from https://services1.arcgis.com/4yjifSiIG17X0gW4/ArcGIS/rest/services/JoshuaTreeImages/FeatureServer/0 :

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
FrancescoTonini2
Occasional Contributor II

Thanks for the pointer Rob!

I will download the fixed to the code there. However, I still have to solve my question (1): what is list.json to register the widget? and (2) re: the word "Demo" to still appear in the widget name I attached (zipped). If you have any pointers for those as well please let me know...Thank you!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Francesco,

1. Yes you can ignore step 4 as you have seen there is no list.json

2. Sounds like you missed this part of step 5: 

In the nls folder, update the value of the _widgetLabel variable to ListView in the strings.js files

0 Kudos
FrancescoTonini2
Occasional Contributor II

Rob,

That is the strange part...The widget I attached to this thread has the following code included in the /nls folder...hence why I am confused on why it still shows the label "Demo"..instead of ListView...

/nls/strings.js

define({
      root: ({
            _widgetLabel: "ListView"
      })
});

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Francesco,

   The widget attachment you have earlier in this thread came from the stemApp widgets folder or the Apps widget folder?

0 Kudos
FrancescoTonini2
Occasional Contributor II

The widget I attached was copy/pasted and modified out of the "Demo" widget inside the ~client/stemapp/widget/samplewidgets. Following the tutorial instructions, I created my own copy of that folder and saved it into the .../stemapp/widgets so it becomes available to any new app that I create. I then changed the name of the folder and all widget files inside it to replace the word "demo" with "ListView", so there is nothing left with the word "demo" in my widget folder...hence my confusion.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Francesco,

   What happen if you restart WAB and create a new app?

0 Kudos
FrancescoTonini2
Occasional Contributor II

Rob,

Apparently refreshing the page did not help but restating the entire WAB did the trick! Seems like they still have some issues thought with their ListView widget...even using the zipped one provided by the ESRI employee at the end of the thread you linked at the beginning does not show all the thumbnails and title correctly...Oh well, hopefully they will fix it for good soon.

0 Kudos