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
BBSJdev
Posts: 4,906
Registered: ‎07-05-2012
My Carrier: Orange

Re: unable to get asset

... and is this problem still related to the OP or have you solved that and are now on a new problem?

 

Please only one problem per thread.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
babakar
Posts: 622
Registered: ‎05-29-2012
My Carrier: see later

Re: unable to get asset

Here is it again

 

This Summary.qml and AccountSummary.qml

 

import bb.cascades 1.0

    Container {
        Container {

            preferredWidth: Infinity
            background: style.black
            TopBar {
                id: bar
                layoutProperties: StackLayoutProperties {
                    spaceQuota: -1
                }
            }
            layoutProperties: StackLayoutProperties {
                spaceQuota: -1
            }
        }
        NetworkActivity {
            id: progressIndicator
            
            horizontalAlignment: HorizontalAlignment.Fill
            verticalAlignment: VerticalAlignment.Fill
        }
        ListView {
            objectName: "customList"
            id: customList

            listItemComponents: [
                ListItemComponent {
                    
                    Container {
                        id:itemRoot
                        background: imageBackground.imagePaint
                        attachedObjects: [
                            ImagePaintDefinition {
                                id: imageBackground
                                repeatPattern: RepeatPattern.XY
                                image: imageTracker.image
                            },
                            ImageTracker {
                                id: imageTracker
                                imageSource: "asset:///images/background.amd"
                            }
                        ]
                        Container {
                            
                            leftPadding: 20
                            rightPadding: 20
                            layout: StackLayout {
                                orientation: LayoutOrientation.LeftToRight
                            }
                            Label {
                                text: "A/C Number"
                                layoutProperties: StackLayoutProperties {
                                    spaceQuota: 2
                                }
                            } 
                            Label {
                                text: ListItemData.accountNumber
                                textStyle
                                {
                                    base: SystemDefaults.TextStyles.TitleText
                                
                                }
                                layoutProperties: StackLayoutProperties {
                                    spaceQuota: 3
                                }
                            }
                        }
                        Container {
                            
                            leftPadding: 20
                            rightPadding: 20
                            layout: StackLayout {
                                orientation: LayoutOrientation.LeftToRight
                            }
                            Label {
                                text: "Account Type"
                                layoutProperties: StackLayoutProperties {
                                    spaceQuota: 2
                                }
                            } 
                            Label {
                                text: ListItemData.type
                                textStyle
                                {
                                    base: SystemDefaults.TextStyles.TitleText
                                
                                }
                                layoutProperties: StackLayoutProperties {
                                    spaceQuota: 3
                                }
                            }
                        }
                         
                        Container {
                            
                            leftPadding: 20
                            rightPadding: 20
                            bottomPadding: 20
                            layout: StackLayout {
                                orientation: LayoutOrientation.LeftToRight
                            }
                            Label {
                                text: "Account Balance"
                                layoutProperties: StackLayoutProperties {
                                    spaceQuota: 2
                                }
                            } 
                            Label {
                                text: ListItemData.availableBalance
                                textStyle
                                {
                                    base: SystemDefaults.TextStyles.TitleText
                                
                                }
                                layoutProperties: StackLayoutProperties {
                                    spaceQuota: 3
                                }
                            }
                        } 
                    }
                    
                    }     
            ]
            onTriggered: {
               
            }
        }

    }


 

 

Tabs.qml

 

import bb.cascades 1.0

TabbedPane {
    showTabsOnActionBar: false
    id: tabPane
    Tab {

        title: "Summary"
        id: tab1
        onTriggered: {
            alkhaliji.invisible();
        }
        NavigationPane {
            id: summaryNavigationPane
            objectName: "summaryNavigationPane"
            onPopTransitionEnded: { page.destroy(); }
            Page{
            	content: AccountSummary {
                 
             }
                attachedObjects: [
                    ComponentDefinition {
                        id: summaryDetails
                        source: "SummaryDetails.qml"
                    }
                ]
            }

	    }
    }
    Tab {
        title: "Accounts"
        Page {
            id: page2
            attachedObjects: [
                Sheet {
                    id: mySheet2
                    content: Page {
                        Button {
                            text: "Close Sheet"
                            onClicked: mySheet2.close()
                        }
                    }
                }
            ]
            actions: [

                ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: "Edit"
                },
                ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: "Save"
                },
                ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: "Save"
                    onTriggered: {
                        mySheet2.open();
                    }
                },
                ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: "Save"
                },
                ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: "Save"
                },
                ActionItem {
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    title: "Save"
                }
            ]
        }
    }
    Tab {
        title: "Deposits"
        Page {
            id: page3

            attachedObjects: [
                Sheet {
                    id: mySheet
                    content: Page {
                        Button {
                            text: "Close Sheet"
                            onClicked: mySheet.close()
                        }
                    }
                }
            ]
            actions: [
                ActionItem {
                    title: "Show Sheet"
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    onTriggered: {
                        mySheet.open();
                    }
                }
            ]
        }
    }
    Tab {
        title: "Loans"
    }
    Tab {
        title: "Payments"
    }
    Tab {
        title: "Standing Instructions"
    }
    Tab {
        title: "Settings"
    }
    Tab {
        title: "Logout"
        onTriggered: {
            alkhaliji.goToGuestMenu();
        }
    }
    attachedObjects: [
        Style {
            id: style
        }
    ]
}

 

 

bolded part I get error

 

bb::cascades::QmlDocument: error when loading QML from:   QUrl( "asset:///Tabs.qml" )  
--- errors:  (asset:///Tabs.qml:18:23: AccountSummary is not a type)
bb::cascades::QmlDocument:createRootObject document is not loaded or has errors, can't create root

 

 

If I replace it with Summary {} I dont get error ...rather the error unable to get asset in  error..

 

this is first time i am so angry in bb development..such a **bleep** and inexplainable error.

Please use plain text.
Developer
babakar
Posts: 622
Registered: ‎05-29-2012
My Carrier: see later

Re: unable to get asset

If I take the entire code

 

and instead of writing in tabs.qml accountsummary {} or summary {}  i get the error

 

unable to get asset in..

Please use plain text.
Developer
BBSJdev
Posts: 4,906
Registered: ‎07-05-2012
My Carrier: Orange

Re: unable to get asset

@babakar Calm down it is not inexplainable, the error is telling you exactly what the problem is, it CANNOT create the AccountSummary object.

 

There is likely an error in that code and is likely to be one of the things I've mentioned above.

 

Please answer this...

 

DO YOU HAVE ANY MARKERS WHEN LOOKING AT THE QML CODE THAT INDICATES AN ERROR OR WARNING?

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
babakar
Posts: 622
Registered: ‎05-29-2012
My Carrier: see later

Re: unable to get asset

no it doesnt. no error or warning in the qml code

but lets assume what u say its true..
how the heck then Summary { } works..and i get unable to gett asset error.. but same code written in AccountSummary.qml i get that error. isnt it strange?
Please use plain text.
Developer
babakar
Posts: 622
Registered: ‎05-29-2012
My Carrier: see later

Re: unable to get asset

I selectall from summary.qml to accountsummary.qml ..

same code, copy paste

 

one works ( ends up with error unable to get asset)..the other gets error bb::cascades::QmlDocument: error when loading QML from:   QUrl( "asset:///Tabs.qml" )  
--- errors:  (asset:///Tabs.qml:18:23: AccountSummary is not a type)
bb::cascades::QmlDocument:createRootObject document is not loaded or has errors, can't create root

 

 

Summary{}

AccountSummary{}

 

inside tabs, no reds no warnings in qml code.

Please use plain text.
Developer
BBSJdev
Posts: 4,906
Registered: ‎07-05-2012
My Carrier: Orange

Re: unable to get asset

If it is an exact copy then it is a scope problem most likely, try doing a clean rebuild of your app and checking that it is in the same folder as the Accounts qml.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
babakar
Posts: 622
Registered: ‎05-29-2012
My Carrier: see later

Re: unable to get asset

another thing...

 

if inside tabs.qml ..i take the code written in AccountSummary.qml  copy paste it to tabs.qml instead of writing

AccountSummary{} I am back to the error unable to get asset for the image..

Please use plain text.
Developer
babakar
Posts: 622
Registered: ‎05-29-2012
My Carrier: see later

Re: unable to get asset

I did clean million times.
Please use plain text.
Developer
babakar
Posts: 622
Registered: ‎05-29-2012
My Carrier: see later

Re: unable to get asset

infact i deleted the project, and rcreated new project even twice.
Please use plain text.