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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
BrajeshSanodiya
Posts: 101
Registered: ‎08-03-2011
My Carrier: BlackBerry Developer

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
mgoulet
Posts: 329
Registered: ‎05-07-2012
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: 101
Registered: ‎08-03-2011
My Carrier: BlackBerry Developer

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: 100
Registered: ‎05-11-2011
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
mgoulet
Posts: 329
Registered: ‎05-07-2012
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.