OH3 MainUI oh-repeater "loop" value question

Hi guys,

trying to play around with the UI and found following situation:

- component: oh-repeater
     sourceType: range
     for: room
     rangeStart: 1
     rangeStop: 7
     fragment: true

If I now use some component (ex. list-item) and assign as text/display value
title: "= loop.room"
For loop.room === 0 i just get a blank field for 1 onward normal behaviour
But if i use something like
title: “=(loop.room === 0) ? ‘0’ : loop.room”
So it has the right values for sure but it does not display them.

My problem is now that if i use JSON.parse('someitem')[loop.room] i get only values for ‘1’ and onward not for ‘0’

Any suggestions?

Tried JSON.parse('someitem')[((loop.room === 0) ? '0' : loop.room)] but same as without ‘if loop’. It would work if I start the range from 1 but then I have to rewrite a whole bunch of stuff) - And just to clarify: The JSON String to read from is correct (works in OH2/3 with habpanel)

Try maybe Number.parseInt(loop.room.toString())

1 Like

Ah as always your a big help.

Number.parseInt(loop.room.toString()) does not work (“unknown”) but


Also what I experienced is that with 2 oh-repeat inside the widget, editing is realy slow like if you type something in it takes 2-3 seconds to appear (same for deleting). Overall it does not affect the performance of the widget itself (on the page)