Select to view content in your preferred language

ListInput problem in WAB

940
7
Jump to solution
03-30-2018 04:01 AM
MatejSkerjanc
Occasional Contributor

Hello

i've assembled a crude test Dojo JSFiddle Template - JSFiddle  of list input. This works flawlessly in jsfiddle but in WAB custom widget the input reports errors.

Has anyone used this cool dojo widget ListInput successfully in WAB developers edition? Or did anyone else get this issue and solved it?

Thank you for the help in advance

Best regards,

Matej  

0 Kudos
1 Solution

Accepted Solutions
Adri2cPérez_Beneito
Occasional Contributor

Hi! 

You can visit my GitHub. I just added an example. 

Cheers!

View solution in original post

7 Replies
Adri2cPérez_Beneito
Occasional Contributor

Hi! 

You can visit my GitHub. I just added an example. 

Cheers!

MatejSkerjanc
Occasional Contributor

Hello mrs Adri2c

havent had the chance to test since i've used multi select instead for the moment, but what makes your example tick?

the define line 'xstyle/css!https://dojotoolkit.org/scripts/dojo/dojox/form/resources/ListInput.css' ?

0 Kudos
MatejSkerjanc
Occasional Contributor

I tried basic sample from your example

new ListInput({
name: 'Dynamic',
value: "Hello!, it's Dojox!, :)"
}, this.listNode);

and i get a.destroy is not a function

0 Kudos
Adri2cPérez_Beneito
Occasional Contributor

Hi!

Dojox Input List needs this css style. Here getting it using http.

Hm, are you using 'data-dojo-attach-point' instead of 'id' in your html file? Also be careful with the order of imports.

Cheers

0 Kudos
MatejSkerjanc
Occasional Contributor

i used both ways attach point and regular div. Both provide same result - same error as mentioned above

0 Kudos
MatejSkerjanc
Occasional Contributor

Pastiebin.com 5ac321f83c11c 

this is the part of the code

0 Kudos
MatejSkerjanc
Occasional Contributor

god...i noticed the issue at least the general vicinity of issue. I've extended array with distinct i guess it doesnt like it. I'll check what's going on. Thanks for the sample i marked it as solved and valid!

// if (!Array.prototype.distinct) {
// Array.prototype.distinct = function () {
// function onlyUnique(value, index, self) {
// return self.indexOf(value) === index;
// }

// if (Array.prototype.filter) {
// return this.filter(onlyUnique);
// }
// else {
// var o = {}, a = [], i, e;
// for (i = 0; e = this; i++) { o = 1 };
// for (e in o) { a.push(e) };
// return a;
// }
// }
// }