Dataview carousel widget - parameter attr is not of type String.

1
Hi all, I've been struggling with the following error in the Dataview carousel widget (in mendix 5.17.0). The following error shows in the console of the browser: mendix.sys.Data.get: error in error handler for xpath //Gedenkplaats.Foto[Gedenkplaats.Fotoalbum_Foto_Carousel = '5348024557505365'] : mendix.lib.MxMetaObject.getAttributeType : parameter attr is not of type String. I've tried it without quotes, with double quotes around the id, and with single quotes. But it keeps coming back to this error. Below I've added a code snippet from the Carousel.mpk setDataobject : function(dataobject) { var self = this; var path = (this.refentity + "/" + this.refcaptionattr ).split("/"); var constraint = "//" + path[1] + "[" + path[0] + " = " + dataobject.getGUID() + "]"; this.captionattr = path[2]; var schema = []; schema.push(this.refcaptionattr); mx.data.get({ xpath: constraint, filter : { sort : [[this.refsortattr, "asc"]], attributes : schema }, callback : function(mxObjs) { //use self instead of this - dojo hitch will screw up the scope of the render function self.mxObjects = mxObjs; self.renderHTML(mxObjs); } }); }, Download example project here We couldn't find anything on how to fix this xpath, any help is greatly appreciated! With kind regards, Stephan
asked
1 answers
4

The problem is in another part: the renderHTML

    if (this.imageattr != '') {

The imageattr is not defined. That 'value' is not equal to '', empty string. Thus it will try to read a value of an empty attribute. it should be

        if (this.imageattr) {
answered