I’ve got a dropdown view that sits in a table column with view render type. It sends a message to the page when it changes to update the item of the selected object in the list of objects by handing the ‘row’ and ‘value’ as an int or a long (I’ve tried both). I’ve tried a couple variations of the logic:
(On the premise that maybe the update function directly on the child of the list was problematic)
temp = self.view.custom.object.listOfObjects
# I've also tried casting parts to a list
temp[payload['row']].update({'item':payload['value']})
self.view.custom.object.listOfObjects = temp
Instead of changing the array, though, I get a new custom property object.listOfObjects[0] (which the designer doesn’t like as a key name of course) with the value {'item':intValue}.
Is there something that I’m doing wrong to update a single key in an object contained in a list?
Ok, I just realized that if I just assign it like self.view.custom.object.listOfObjects[int(payload['row'])]['item'] = payload['value'] it works perfectly fine. Not sure why the update function is weird, even if I cast everything to “normal” python types, but problem fixed I guess?
Oh, ok. I had poked around for several hours trying to find something about it. I didn’t include the term object wrapper since when I find solutions to problems here, they don’t tend to have the right namings, so I usually just describe the end result that’s unwanted. Thank you for attaching those links, though.
Man, of course you did. It sounds like your toolkit has everything one would need to solve all the little issues (quirks?) with Ignition. I hope I eventually get to work on it in a professional environment and not just my home bench.