cmv / cmv-wab-widgets

Examples of using widgets from the ESRI WebApp Builder in CMV
https://cmv.github.io/cmv-wab-widgets/demo.html?config=wab
MIT License
9 stars 19 forks source link

Filter Widget Error - 'isShowInMap' null #22

Closed mayur9785 closed 6 years ago

mayur9785 commented 7 years ago

Hi,

I added Filter widgets and when I hit apply I get the error at line number 303 in widgets.js file of Filter widget "Cannot read property 'isShowInMap' of null".

5

6

7

below is widgets configuration in Viewer.js

filter: {
                include: true,
                id: 'filter',
                type: 'titlePane',
                iconClass: 'fa fa-filter',
                position: 10,
                title: 'Filter',
                path: 'jimu/BaseWidgetPanel',
                canFloat: true,
                open: false,
                options: {
                    // use the WAB WidgetManager (required)
                    widgetManager: true,
                    layerControlLayerInfos: true,
                    //style: 'min-height: 500px;',
                    config: {
                        widgets: [
                            {
                                id: 'WABFilter',
                                uri: 'wabwidgets/Filter/Widget', // Note the path
                                // more complex configuration passed to WAB Widget
                                config: {
                                    filters: [{
                                          "url": "https://myserver.com/arcgis/rest/services/Road/MapServer/0",
                                        "name": "Project Type",
                                        "filter": {
                                            "logicalOperator": "AND",
                                            "parts": [{
                                                "fieldObj": {
                                                    "name": "PROJECT_TYPE",
                                                    "label": "PROJECT_TYPE",
                                                    "shortType": "string",
                                                    "type": "esriFieldTypeString"
                                                },
                                                "operator": "stringOperatorIs",
                                                "valueObj": {
                                                    "isValid": true,
                                                    "type": "unique",
                                                    "value": ""
                                                },
                                                "interactiveObj": {
                                                    "prompt": "Project Type is",
                                                    "hint": "",
                                                    "cascade": "none"
                                                },
                                                "caseSensitive": false
                                            }],
                                            "expr": ""
                                        },
                                        "icon": "",
                                        "enableMapFilter": true
                                    }, {
                                         "url": "https://myserver.com/arcgis/rest/services/Road/MapServer/0",
                                        "name": "Works Programme",
                                        "filter": {
                                            "logicalOperator": "AND",
                                            "parts": [{
                                                "fieldObj": {
                                                    "name": "WORKS_PROGRAMME",
                                                    "label": "WORKS_PROGRAMME",
                                                    "shortType": "string",
                                                    "type": "esriFieldTypeString"
                                                },
                                                "operator": "stringOperatorIs",
                                                "valueObj": {
                                                    "isValid": true,
                                                    "type": "unique",
                                                    "value": ""
                                                },
                                                "interactiveObj": {
                                                    "prompt": "Works Programme is",
                                                    "hint": "",
                                                    "cascade": "none"
                                                },
                                                "caseSensitive": false
                                            }],
                                            "expr": ""
                                        },
                                        "icon": "",
                                        "enableMapFilter": true
                                    }, {
                                          "url": "https://myserver.com/arcgis/rest/services/Road/MapServer/0",
                                        "name": "Audit Type",
                                        "filter": {
                                            "logicalOperator": "AND",
                                            "parts": [{
                                                "fieldObj": {
                                                    "name": "AUDIT_TYPE",
                                                    "label": "AUDIT_TYPE",
                                                    "shortType": "string",
                                                    "type": "esriFieldTypeString"
                                                },
                                                "operator": "stringOperatorIs",
                                                "valueObj": {
                                                    "isValid": true,
                                                    "type": "unique",
                                                    "value": ""
                                                },
                                                "interactiveObj": {
                                                    "prompt": "Audit Type is",
                                                    "hint": "",
                                                    "cascade": "none"
                                                },
                                                "caseSensitive": false
                                            }],
                                            "expr": ""
                                        },
                                        "icon": "",
                                        "enableMapFilter": true
                                    }, {
                                        "url": "https://myserver.com/arcgis/rest/services/Road/MapServer/0",
                                        "name": "Audit Stage",
                                        "filter": {
                                            "logicalOperator": "AND",
                                            "parts": [{
                                                "fieldObj": {
                                                    "name": "AUDIT_STAGE",
                                                    "label": "AUDIT_STAGE",
                                                    "shortType": "string",
                                                    "type": "esriFieldTypeString"
                                                },
                                                "operator": "stringOperatorIs",
                                                "valueObj": {
                                                    "isValid": true,
                                                    "type": "unique",
                                                    "value": ""
                                                },
                                                "interactiveObj": {
                                                    "prompt": "Audit Stage is",
                                                    "hint": "",
                                                    "cascade": "none"
                                                },
                                                "caseSensitive": false
                                            }],
                                            "expr": ""
                                        },
                                        "icon": "",
                                        "enableMapFilter": true
                                    }]
                                }
                            }
                        ]
                    }
                }
            },

Please suggest me on this.

tmcgee commented 6 years ago

@mayur9785 Sorry I was unable to look into this at the time. Is it still an issue?

mayur9785 commented 6 years ago

Hi Tim, I still have the issue. I tried to find the solution but didn't get.

triesco commented 6 years ago

Im having same issue and I think it is exepcting a layerid from webmap or wab. Has anyone been able to find a solution for this??