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: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Capturing signal in new NavigationPane schema (How to)

[ Edited ]

Hi,

 

How are you supposed to capture a signal in the new schema for navigating pages?

 

Question: where do I put or attach the onTemplateChanged() slot?

 

Example (code boiled down for brevity)

 

add.qml

 

Page
{
  Container{
    layout: StackLayout{ }     Button{
      id: cardTemplateId
      text: "Select template..."       onClicked: {
        var page = pageTemplateSelectionId.createObject();
        navigationPane.push(page);       }     }   }
  attachedObjects: [     ComponentDefinition{       id: pageTemplateSelectionId       source: "TemplateListView.qml"     }   ] }

 

 

TemplateListView.qml

 

Page

{
  signal templateChanged(variant template);
  id: pageTemplateList

  Container {
    ListView {

      [...standard listview code cut...]

    onTriggered: {
      var chosenItem = dataModel.data(indexPath);
      navigationPane.pop();

      templateChanged(chosenItem);
    }
  }
}

 

 

I've tried picking it up in the ComponentDefintion and in the Button but get various problems as it is being dynamically created (either QML error or code execution error).

 

Help gratefully appreciated.


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: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Capturing signal in new NavigationPane schema (How to)

[ Edited ]

Forgot to mention, I've looked at the code samples but none of them do this they either use Sheets directly not dynamically or call a function (C++ or JavaScript) or edit a property in the previous page directly.

 

I can't do this as I'm unsure which page will be calling the templateselection page.

Nothing in any of the documentation as far as I can see after several hours of looking.

 

There must be a way of passing back a selection to a previous page?


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.