What is the working, not deprecated alternative for below code?
What is the working, not deprecated alternative for below code?
function ClearList(item) {
var Ritems = item.getItems();
for (var j = 0; j < Ritems.getLength(); j++) {
item.removeItem(Ritems.getAt(j));
}
}
My guess was:
function ClearList(item) {
var Ritems = item.getAllItems();
for (var j = 1; j <= Ritems.length; j++) {
item.removeItem(Ritems[j]);
}
}
But the “removeItem” throws an error 🙁
]]>
< ![CDATA[
I guess the error is OutOfBoundsException ? It should start at 0 and end at length-1 as with the Array object.
]]>
< ![CDATA[
Well…. Today it is… After a phone restart.
There’s some kind of version caching going on.
]]>
< ![CDATA[
Btw..
About depricaton:
getItems –> getAllItems
but
getAllBinding –> getBindings
]]>
< ![CDATA[
Yes I know, but I couldn’t rename methods to make them coherent as it would have break compatibility with existing scripts 🙁
]]>