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
edusal100
Posts: 108
Registered: ‎09-21-2013
My Device: Blackberry Z10 STL100-1

create an object from one qml and insert it in to another

Hi, I have an addPage qml and from there I want to create a new tab in another qml, I have something like this, what it's missing?

On triggered {
Var selected item = dataModel.data(indexPath);
Listmodel.addCity(selectedItem.text);
Var createdControl = pageDefinition.createObject()

And then I try with the id of my table pane, tabbedPane.add(createdControl)

But doesn't seems to work
Please use plain text.
Developer
greenmr
Posts: 882
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: create an object from one qml and insert it in to another

First off, please use the "code" button when posting code.

 

Second, is the actually the code you are using? If so, this line is not valid:

 

Var selected item = dataModel.data(indexPath);

Finally, we don't know what your page definition looks like so we don't know if the pageDefinition.createObject() line will work.


edusal100 wrote:
Hi, I have an addPage qml and from there I want to create a new tab in another qml, I have something like this, what it's missing?

On triggered {
Var selected item = dataModel.data(indexPath);
Listmodel.addCity(selectedItem.text);
Var createdControl = pageDefinition.createObject()

And then I try with the id of my table pane, tabbedPane.add(createdControl)

But doesn't seems to work





Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
Please use plain text.