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
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
Accepted Solution

A simple question- how to embed an URL to Cascade UI?

I am trying to add an URL to a screen. When the use click the URL, the web browser will automatically open the URL. How can I implement by Cascade?

 

Thank you




p(^_^)q
Good good study, day day up
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: A simple question- how to embed an URL to Cascade UI?

I found that Textarea can automatically recognize the URL. Is there other way to implement it?




p(^_^)q
Good good study, day day up
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10

Re: A simple question- how to embed an URL to Cascade UI?

Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: A simple question- how to embed an URL to Cascade UI?

Thank you for your suggestion. Yes, it is available. But for some URLs in one article say one news includes multiple urls, the urls should be automatically recognized otherwise there is not any response when the users click the url.

 

I found if I put urls in a textarea controller, the urls can be recognized and it will invoke the browser automatically. But it is not available for the label yet. 




p(^_^)q
Good good study, day day up
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10

Re: A simple question- how to embed an URL to Cascade UI?

I think a Label isn't meant for displaying large texts. That's the reason why the feature to open URLs is missing.

 

But you can open a single URL by listening for the touch-up event.

 

Label {
    onTouch: {
        if (event.isUp()) {
            // Invoke browser
        }
    }
}

 

Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: A simple question- how to embed an URL to Cascade UI?

Thank you for your reply. I think that your solution is a good way to open URL by label.




p(^_^)q
Good good study, day day up