I am going through this tutorial and I keep getting this error:
Tutorial: Create a ListView widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers
Attached is the code.
Sam, if this has answered your question, please click the Mark Correct on the post that helped you.
As a reminder, you have started several discussions which garnered many answers. If those have been sufficiently answered, please mark the appropriate posts as correct. This will help others as they search for answers on similar questions.
The order of the require modules doesn't match the order of the function arguments. Since you haven't provided an argument for "dijit/form/Select", you have to move that after "jimu/dijit/Message".
define([
"dojo/_base/declare",
"jimu/BaseWidgetSetting",
"dojo/_base/lang",
"dojo/_base/array",
"dijit/_WidgetsInTemplateMixin",
"jimu/LayerInfos/LayerInfos",
"jimu/dijit/Message",
"dijit/form/Select"
], function (
declare,
BaseWidgetSetting,
lang,
array,
_WidgetsInTemplateMixin,
LayerInfos,
Message
) {
Upon further testing, this.config will also not get created if you add a map that has only a map service and not a feature layer. It returns a value of "ArcGISMapServiceLayer". You can test for this by adding lines 9-14 instead of the test from my last post
array.forEach(infos, function (info) {
if (info.originOperLayer.layerType === "ArcGISFeatureLayer") {
options.push({
label: info.title,
value: info.id
});
}
});
if (options.length == 0) {
new Message({
type: "error",
message: "There are no valid feature layers in this map!"
});
}
this.layerSelect.set("options", options);
Note that this just warns your about not having any feature layers. If you go ahead and configure the widget without the layers, you'll still get that error when trying to use the widget. But then, why would you configure the app to use the widget without any feature layers?
Okay thanks for all the help.
Is there a way to not need to specify a picture Icon in this widget and just have another data field?