09-04-2012 06:40 AM
Hello,
I am trying to implement the functionality provided by the ComponentDefinition class as shown on the following page,
https://developer.blackberry.com/cascades/referenc
Unfortunately an error occured when running the application and loading the qml file . The console output follows,
ComponentDefinition is not a type
Any advices anyone?
Solved! Go to Solution.
09-04-2012 10:47 AM - edited 09-04-2012 10:57 AM
Yes I too got the same error.
I also tried changing ComponentDefinition with QmlComponentDefinition as analogous to ImagePaintDefinition when used with attachedObjects property to define an ImagePaint to draw a background image for the respective control.
This too results in the same error
Error 1 A colon after attachedObject property was missing
Error 2 Padding property is not available for Container object
Error 3 Actually no such classes named ComponentDefinition and QmlComponentDefinition were found in API References like we have class ImagePaintDefinition to define an ImagePaint in QML when used inside attachedObjects property.
https://developer.blackberry.com/cascades/referenc
10-30-2012 06:37 AM
Hi, Did you get solution for the above problem?
I am getting same error message.
Kindly help.
Thanks and regards,
Shubhangi
10-30-2012 09:35 AM
Hi discnick,
I tried making a sample for using Componentdefinition provided on the same link you've referred: https://developer.blackberry.com/cascades/referenc
Following is the code & I'm getting No such error like "Component Definition is not a Type" while running. The code is working successfully in my beta3 device.
import bb.cascades 1.0
Page {
Container {
Button {
text: "Click to create bordered text"
onClicked: {
// creates borderedTextComponent control and appends it to container
var createdControl = borderedTextComponent.createObject();
container.add(createdControl);
createdControl.textString = "Hello Component";
createdControl.padding = 30;
createdControl.textColor = Color.DarkGray;
}
}
Container {
id: container
}
attachedObjects: [
ComponentDefinition {
id: borderedTextComponent
Container {
property variant borderColor: Color.Red
property variant fillColor: Color.White
property variant textColor: Color.Black
property string textString
property real padding: 10
background: borderColor//Color.Black //
leftPadding: padding
rightPadding: padding
topPadding: padding
bottomPadding: padding
Container {
background: fillColor// Color.Blue
Label {
text: textString
textStyle.color: textColor//Color.Green //textColor
}
}
}
}
]
}
}No special inclusion for any file in app.cpp. Nothing.
10-31-2012 01:54 AM
Hi,
I tried sample given in the article but unable to run it.
Same error is occuring.
Kindly help.
Thanks and regards,
Shubhangi
10-31-2012 04:14 AM
Sry for the delay guys.
The problem does not exist any more.
I think the problem fixed once I updated my SDK to Beta 3 ( not 100% sure though..).
@ Shubhangi : can you confirm that you are using the Beta 3?
10-31-2012 06:37 AM
Hi Discnick,
How to check whether I am having beta2 or beta3?
Also How to upgrade to Beta3? Do I need to download Beta3 native SDK from Download and then install it directly on laptop?
Let me know.
Thanks and regards,
Shubhangi
10-31-2012 08:48 AM
Hi Shubhangi
From inside the QNX Momentics IDE , go to : Help - About QNX Momentics IDE. On the About QNX Momentics IDE dialog check your version . The Beta 3 version number is : 10.0.9 .
In case you have not updated to Beta 3 , you should also look at this link also
https://developer.blackberry.com/cascades/document
11-01-2012 01:45 AM
Hi,
Thanks for reply.
I am having Beta2 version. I will upgrade the version to Beta3.
Thanks and regards,
Shubhangi
11-01-2012 09:06 AM