Skip to content

Fix duplicate entries in TBoldObjectList.InternalAddNew #33

@bero

Description

@bero

Problem

When using TBoldNavigator's Insert button on a list handle bound to an allInstances expression (e.g., Project.allInstances), newly created objects appeared twice in the grid.

Cause

InternalAddNew calls CreateNew, which automatically registers the object in the system's class extent. It then calls ObjectListController.AddLocator directly, bypassing the duplicate prevention logic in TBoldObjectList.AddLocator.

For allInstances lists, this results in the same object being added twice.

Solution

Check if the object's locator already exists in the list before adding new in InternalAddNew

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions