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
Retired
Posts: 35
Registered: ‎08-01-2012
My Device: BB10 alpha-BB10 developer
My Carrier: T-Mobile

Re: Registration Screen Handling

Hi Blueboser,

 

You are at a better position than us to make the decision when/why you want to detroy the "sheet" object.

 

FYI, "destory()" is the method to delete QML object dynamically.

http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedynamicobjects.html

 

Just a suggestion:

As you mentioned that you have "TabbedPane" as you main flow, you may consider to look at the project template for "TabbedPane" and the project template for "Application with the sheet", then, you can come out the design best fit for your project.

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Registration Screen Handling

I'm using TabbedPane together with Sheet to LogIn

 

https://github.com/blackberry/opendataspace-cascades

 

ekke

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 404
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: Registration Screen Handling

ekke,

 

I downloaded and installed the app. When I tried to install it to my Dev Alpha device, it gave me an

 

Error: Invalid asset path

"/datum/opendataspace-cascades"

 

error

 

Any solution?

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Registration Screen Handling

you downloaded from Appworld or from Github ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Registration Screen Handling


Bluenoser wrote:

ekke,

 

I downloaded and installed the app. When I tried to install it to my Dev Alpha device, it gave me an

 

Error: Invalid asset path

"/datum/opendataspace-cascades"

 

error

 

Any solution?


found it:

there was a asset path in bar descriptor pointing to a local folder

don't know why

 

fixed it, pushed

https://github.com/blackberry/opendataspace-cascades/commits/master

 

please pull the changes

git://github.com/blackberry/opendataspace-cascades.git

 

ekke

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 404
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: Registration Screen Handling

[ Edited ]

I have been trying to create my own registration and login sheets without much success. I have tried the suggestions and have looked at ODS code. I am trying to start with something simple. I just want to open the registrationSheet when the TabbedPane onCreationCompleted is fired. I can't get the Sheet to be displayed. I have tried .open() and .visible == true with no success. Here is my code.

 

main.qml

 

import bb.cascades 1.0

TabbedPane {

    showTabsOnActionBar: true

     attachedObjects: [
         Sheet {
             id: registrationSheet
             objectName: "registrationSheet"
             content: RegistrationSheet {
                 id: registrationContent
             }
         },
         Sheet {
             id: loginSheet
             objectName: "loginSheet"
             content: LoginSheet {
                 id: loginContent
             }
         }
     ]

    Tab {
        title: qsTr("Tab 1")
        Page {
            id: tab1
            Container {
                Label {
                    text: qsTr("Tab 1 title")
                    horizontalAlignment: HorizontalAlignment.Center
                    textStyle {
                        base: SystemDefaults.TextStyles.TitleText
                    }
                }
            }
        }
    }
    Tab {
        title: qsTr("Tab 2")
        Page {
            id: tab2
            Container {
                Label {
                    text: qsTr("Tab 2 title")
                    horizontalAlignment: HorizontalAlignment.Center
                    textStyle {
                        base: SystemDefaults.TextStyles.TitleText
                    }
                }
            }
        }
    }
    Tab {
        title: qsTr("Tab 3")
        Page {
            id: tab3
            Container {
                 Label {
                    text: qsTr("Tab 3 title")
                    horizontalAlignment: HorizontalAlignment.Center
                    textStyle {
                        base: SystemDefaults.TextStyles.TitleText
                    }
                }
            }
        }
    }
    onCreationCompleted: {
        OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
        
        registrationSheet.open()

        registrationContent.registered.connect(onRegistered)
        registrationContent.loggedin.connect(onLoggedIn)
        
    }
    
    function onRegistered() {
        registrationSheet.close()
    }
    
    function onLoggedIn() {
        loginSheet.close()
    }
}

 

RegistrationSheet.qml

 

import bb.cascades 1.0

Page {
    
    signal registered()
    
    Container {
        Label {
            text: qsTr("Register")
            horizontalAlignment: HorizontalAlignment.Center
            textStyle {
                base: SystemDefaults.TextStyles.TitleText
            }
        }
    }
}

 LoginSheet.qml

 

import bb.cascades 1.0

Page {
    
    signal loggedin()
    
    Container {
        Label {
            text: qsTr("Login")
            horizontalAlignment: HorizontalAlignment.Center
            textStyle {
                base: SystemDefaults.TextStyles.TitleText
            }
        }
    }
}

 Any suggestions?

Developer
Posts: 404
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: Registration Screen Handling

I got it working. My brain meant .open() and my fingers wrote .show(). The code I posted works.

Highlighted
Developer
Posts: 404
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: Registration Screen Handling

[ Edited ]

This is the updated RegistrationSheet.qml with a button to signal registered which will close the registration screen.

 

import bb.cascades 1.0

Page {
    
    signal registered()
    
    Container {
        Label {
            text: qsTr("Register")
            horizontalAlignment: HorizontalAlignment.Center
            textStyle {
                base: SystemDefaults.TextStyles.TitleText
            }
        }
        Button {
            text: "Register"
            onClicked: {
                registered()
            }
            horizontalAlignment: HorizontalAlignment.Center
        }
    }
}