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

Posts: 39
Registered: ‎02-18-2013
My Device: Developer
My Carrier: Don't Know
Accepted Solution

How to set Label text of one view from another view ?



I have two view Home View and Header View.


Home View contains list of values.


On Header view there is Label which is a heading of that layout. 


When user click on any value on home view I want to delegate control to Header View and want to set selected row label text as heding on header view.



Posts: 74
Registered: ‎03-04-2012
My Device: developer
My Carrier: developer

Re: How to set Label text of one view from another view ?

[ Edited ]

First of all if these two view are two separate qml page or single page. if they are saparete pages then you must be using some data model to populate list with data. Now on selection of any list row do this


define property in your home view like this


property variant selectedData

 now in onTriggered signal write this code


selectedData = dataModel.data(indexPath)


and push next page which is your header view there u can use this selectedData property and fetch value to show on header 





text: selectedData.title

 and if you have single page containing both the views 


follow the same steps 


and in that case in ontriggered signal set the text of label


Hope this may help you  Smiley Happy

Deepak Charya