Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: C++ Find Instance of Component Defenition

You should be able to retrieve a list of attached objects using the UIObject::attachedObjects property. From there you could iterate through the list to find the object with a particular object id.

 

Obligatory advice: use iterating like this and findChild sparingly. I'd use a different way of passing references unless this was absolutely necessary.

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: C++ Find Instance of Component Defenition

@superdirt just because something is in attachedObjects doesn't mean it's in the Scene Graph, and we are dealing with dynamic objects here, perhaps you missed that when reading the whole thread.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: C++ Find Instance of Component Defenition

ah I thought OP wanted to find the instance of the ComponentDefinition as the title of the thread suggested. Using attachedObjects wouldn't help in solving the actual problem.

 

I would just store the reference to the sheets in C++. Recursive search through the entire scene is bad.