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

Java Development

Reply
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810
Accepted Solution

Hyperlinks in MainScreen ..

Hi all, hope this question will also be useful for the readers.. :smileywink:

 

Requirement: I have to put some links in a MainScreen where when user clicks on it, it will go for a web page ..

 

Currently, I had put some focusable labels.. On its onFocus(), I just underline the text to simulate like hyperlinks .. On its onUnfocus(), I show it again normally!

 

One doubt here!

Is there a straight way of doing this? That is, does blackberry gives an API to put hyperlinks?

AFAIK, No!

 

In the method, I prescribed above, I wrote browser invocation on navigationClick() , it works just fine .. But when I come back, I see full menu with a copy option..

 

How do I prevent this? The same issue with clickable BitmapField also! (Note: Forums didn't answer it anywhere, in my search)

 

I can ask like this, how can I disable the Full Menu for an application completely - In this scenario, how would you managed to design the application?

 

Post your views ..

 

Cheers...

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Please use plain text.
Developer
Rajat_10Sep
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Hyperlinks in MainScreen ..

Hi,

 

 

You can use ActiveAutoTextEditField this will help you is solving your problem.

 

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Please use plain text.
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Hyperlinks in MainScreen ..

[ Edited ]

@ Rajat! For my big question, is this the answer? :smileyhappy: Well, I'm not trying anything .. Just input your views..

 

Anyway thanks for your input rajat..

 

Edit: Note - I don't want code suggestions or piece of codes ..

 

Cheers..

Message Edited by mantaker on 05-09-2009 08:02 PM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Please use plain text.
Developer
Rajat_10Sep
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Hyperlinks in MainScreen ..

Hi,

 

 

Sorry but did not get what you want to tell.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Please use plain text.
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Hyperlinks in MainScreen ..

Do you want me to explain more :smileysurprised:

 

@ Rajat - Is there an option for disabling the Full Menu option for an application completely?

 

@ Others - please see the thread's start - Hopefully, I'm posting at two of the off days (Sat and Sun :smileywink: ) .. Will bump the thread up, if needed..

Cheers...
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: Hyperlinks in MainScreen ..

Using focusable Labels is an interesting approach.

 

As Rajat has said, another alternative is just to use any of the Active textFields - they automatically handle links (http://...) and will invoke the Browser.  You can see these when you display an email text with links in it.  The 'down side' of these is that you will have to display the full URL, which might be pretty ugly.

 

You might also be able to display a BrowserField, in which case you can populate it with html links, but I think your Label approach is easier.

 

I suspect the reason that you are seeing the Full menu on return from the Browser is either:

a) you do not return true from your navigationClick()

b) you call super,navigationClick()

 

Since you are completely handling the click, then I would return true and not call super.

 

Hope this helps.

Please use plain text.
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Hyperlinks in MainScreen ..

That was it peter!

 

As you might know I'm using Eclipse with JDE plugin for development, and when I override a method using

Right Click -> Source -> Override/Implement Methods..,

 

I can select methods needed for overriding, It actually overrides by returning a call to its super class's same method by default .. Then I would write logic for my own needs :smileywink: ..

 

Yes my overriden method's "return" calls super class's navigationClick (I left it remain Unchanged:smileyhappy:) .. This is the problem .. Hope BitmapField's navigation click should also return true for preventing full menu :smileywink: ..

 

I knew of Actve text fields and I'm not supposed to show full length URLs, and thats why I hadn't shown interest to rajat's answer sorry!

 

And then, BrowserField! The feature I'm going to implement is not that much important and I don't want to make life complicated, I'll use LabelField itself..

 

Thanks for the clarification peter and thanks for the participation Rajat..

 

Cheers... 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Please use plain text.