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
BrajeshSanodiya
Posts: 130
Registered: ‎08-03-2011
My Device: torch, Z10
My Carrier: Vodafone, Airtel

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.
-----------------------------------------------------------------------
Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

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

 

Please use plain text.
Developer
BrajeshSanodiya
Posts: 130
Registered: ‎08-03-2011
My Device: torch, Z10
My Carrier: Vodafone, Airtel

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.
-----------------------------------------------------------------------
Please use plain text.
Developer
raj_jyani
Posts: 107
Registered: ‎05-11-2011
My Device: BlackBerry Z10 LE
My Carrier: AirTel

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
            }
        }
    }
}

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: How To Perform Action on label?

Ok,

 

Give a try to  what raj_jyani is suggesting.

 

Martin

 

Please use plain text.