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
slashkyle
Posts: 798
Registered: ‎10-16-2012
My Device: Red Z10, Dev Alpha C
My Carrier: Telus
Accepted Solution

Issues communicating between QML files

[ Edited ]

I am in the process of trying to split my application up from 1 QML file to a bunch.

 

what i'm having issues with is,

 

OtherQml.qml

import bb.cascades.1.0

Container { id: root property alias otherRoot: root property bool customBool Container { id: otherContent onTouch: { if (event.isUp(){ customBool = true; } } } }

 

main.qml

import bb.cascades.1.0

Page {
	
	Contianer {
		id: root
		
		OtherQml {
			id: otherQml
			
			onCustomBoolChanged: {
				if (! true) {
					root.background = Color.Red;
					console.log("customBool is: " + cusotmBool);
				} else {
					root.background = Color.Blue;
					customBool = false;
//the false signal isnt recieved by OtherQml.qml console.log("customBool is: " + customBool); } } } } }

 

the false signal isnt recieved by OtherQml.qml so the functions are only able to run once or as in this example the background doesnt change to red

Please use plain text.
Developer
Zmey
Posts: 1,508
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Issues communicating between QML files

Hi!

 

if (! true) {

is always false, it should be if (!customBool) {

 

Also there is a typo ('cusotmBool'):

console.log("customBool is: " + cusotmBool);

 

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
slashkyle
Posts: 798
Registered: ‎10-16-2012
My Device: Red Z10, Dev Alpha C
My Carrier: Telus

Re: Issues communicating between QML files

I had only quickly typed up the sample but I think not using (!customBool) was the culprit in my app thanks for the help

 

Please use plain text.