Changed $parent to ListItem.getContainer() to prevent recursion issues