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
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10

How To Perform Action on label?

Hi,

 

I want Action on Label. plz suggest me.

-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
BlackBerry Development Advisor (Retired)
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: How To Perform Action on label?

Hi,

 

I am not sure I understand what you want. What do you mean by action? Do you want to register a callback for when the user touches the label?

 

Martin

 

Developer
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10

Re: How To Perform Action on label?

Hi mgoulet,

I want to show some message when i touches the label and i also want the code for show dialog.

so plz help me.
-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Developer
Posts: 107
Registered: ‎05-11-2011
My Device: BlackBerry Z10 LE

Re: How To Perform Action on label?

Hi,

 

Try this code.

 

import bb.cascades 1.0

Page {
    attachedObjects: [
        CustomDialog {
            id: myCustomDialog
            content: Container {
                Button {
                    text: "Yes"
                    onClicked: myCustomDialog.visible = false
                }
                Button {
                    text: "No"
                    onClicked: myCustomDialog.visible = false
                }
            }
        }
    ]
    content: Container {
        Label {
            id: labelID
            text: "text"
            onTouch: {
                myCustomDialog.visible = true
            }
        }
    }
}

BlackBerry Development Advisor (Retired)
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: How To Perform Action on label?

Ok,

 

Give a try to  what raj_jyani is suggesting.

 

Martin