Can not select string wheel data with blank

I am creating a scroller to select data in a string with blanks e.g.:

 mobiscroll.scroller("#idOfElement", {
      wheels: [
           {
                data: ["Albert Einstein","Marie Curie","Otto Hahn"]
           }
       ]
  });

When the scrooler is initilized users can mark there selction. I can also retrieve and save this selction.

However, when I try to set the value like this

 mobiscroll.instances.idOfElement.setVal("Marie Curie", true);

only the first value in the data (in this example “Albert Einstein”) is selected. Whithout the blanks in the string the correct data is selected.

Is there a trick to e.g. mask the blank so the correct value is selected?

I am using mobiscroll 4.10.7 with javascript

Hi @Engin_Kardes,

I’ve checked and it looks like this is a limitation of the default parseValue function, items which have space will only identify if there is a value property specified in the data.

One possible solution to update the parsValue function to your needs. Example:

 mobiscroll.scroller("#idOfElement", {
      wheels: [
           {
                data: ["Albert Einstein","Marie Curie","Otto Hahn"]
           }
       ],
        parseValue: function (val) {
			const ret = [];

			if (val !== null && val !== undefined) {
				ret.push(val)
			}

			return ret; // Default value if input is empty
		}
  });

Or another possible solution would be to pass your input data as an object and specify the value property which can be used later with the setVal method. Example:

wheels: [
    [{
        data: [{ display: "Albert Einstein", value: 'Albert_Einstein' }, { display: "Marie Curie", value: 'Marie_Curie' }, { display: "Otto Hahn", value: 'Otto_Hahn' }]
    }]
]

Let me know if this helps!

Thank you Szili for your answer.
I checke all of them and they did work.
The one with data/value I tried before. But I do not like that there are different strings shown for the wheel and input field.
Thats why I opted for changing the parseValue. Now the correct data is selected and both strings for the wheel and input field are the same.