Page MenuHome

UI List 'click'-rename doesn't call custom Python properties custom update callback
Closed, ArchivedPublic

Description

Short description of error
If I rename an item from an UIList the item.name update property is not called.

Exact steps for others to reproduce the error
The sample file has a python script and instructions to test it:

The addon is also available here:
https://github.com/dfelinto/addon-samples/blob/master/timeline_markers_manager.py

Event Timeline

Bastien Montagne (mont29) changed the task status from Unknown Status to Archived.Dec 13 2013, 8:59 PM

This is not a bug, more like a collision: both IDProp "name" and struct’s name property share the same identifier, so there is some kind of odd sync between them. But the prop used by default uiList draw_item func is the RNA struct name, while the one used by the string field or accessed through python is the IDProp one (the one having the update callback).

You could even not define the "name" IDProp at all, but you have no way in this case to assign an update callback to the existing "name" RNA prop, I think, so would not be much useful in this case. Only real solution is to define a custom uiList with a custom item_draw func (and perhaps also use another identifier than "name", to avoid collision).