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
Highlighted
Developer
Posts: 266
Registered: ‎04-24-2009
My Device: Not Specified
Accepted Solution

Active RichText Field hyperlink not working

All my research indicates that the following should give me a hyperlink to a web page. For example, I click on the underlined text and the browser starts and displays the web page.

 

        ActiveRichTextField ActiveRichTextField1 = new ActiveRichTextField("http://www.RadicalPhotography.com", RichTextField.TEXT_ALIGN_HCENTER );
        aboutvfm.add(ActiveRichTextField1);

 

The text displays and is underlined, when you select it, it receives focus, so it appears that all is well.  But when I click on it nothing happens.

 

Anyone have any thoughts?

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Active RichText Field hyperlink not working

Where are you placing the field? (what type of screen)?

 

Can you post a more complete code snippet?

 

Developer
Posts: 266
Registered: ‎04-24-2009
My Device: Not Specified

Re: Active RichText Field hyperlink not working

//AboutScreen
        
VerticalFieldManager aboutvfm = new VerticalFieldManager(Field.FIELD_HCENTER);
        
ActiveRichTextField ActiveRichTextField1 = new ActiveRichTextField(http://www.RadicalPhotography.com, RichTextField.TEXT_ALIGN_HCENTER );
aboutvfm.add(ActiveRichTextField1);

        
AboutCloseButton = new ButtonField ("Close", Field.FIELD_HCENTER);
AboutCloseButton.setChangeListener(this);
aboutvfm.add(AboutCloseButton);
       
aboutps = new PopupScreen(aboutvfm);

 

I push the screeen under

 

public void fieldChanged(Field field, int context)
    {

       

     ...

   

     case CustomButtonField.ABOUT:
         pushScreen(aboutps);
         break;

 

JDE 4.7 

 

I hate to overwhelam you with code so I didn't paste everything, but I can add more information if you need me to.

 

Thanks REXDOUG!

Developer
Posts: 342
Registered: ‎02-04-2009
My Device: BB 8320

Re: Active RichText Field hyperlink not working

Replace 

ActiveRichTextField ActiveRichTextField1 = new ActiveRichTextField(http://www.RadicalPhotography.com, RichTextField.TEXT_ALIGN_HCENTER );

 with

 

ActiveRichTextField ActiveRichTextField1 = new ActiveRichTextField("http://www.RadicalPhotography.com", RichTextField.TEXT_ALIGN_HCENTER );

 

 Note: the link has been placed inside double quote (").

 


Use Search. "Accept Solution" if the problem gets resolved.
Developer
Posts: 266
Registered: ‎04-24-2009
My Device: Not Specified

Re: Active RichText Field hyperlink not working

If you take a look at the first post, I had the quotes in and they are in my code too.  I did another build just to be sure.  Same thing.  The text is underlined like it wants to work, but  nothing happens when I click on it.

 

Thanks for the idea though.  I'm not sure how I made those quotes disappear.  Not one of my better talents.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Active RichText Field hyperlink not working

[ Edited ]

Have you overriden navigationClick (or TrackWheeelClick) anywhere?  This would prevent the normal menu being shown with the 'Get Link'.

 

Edit: Prompted by RexDoug's post following to add this:

And make sure in makeMenu that your have not suppressed the context menu.

Message Edited by peter_strange on 05-21-2009 02:45 PM
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Active RichText Field hyperlink not working

Make sure you have added the DEFAULT_MENU style to your PopupScreen - this should give you the context menu when the active item is clicked. The menu should then have the "Get Link" choice.

 

 

 

 

 

Developer
Posts: 266
Registered: ‎04-24-2009
My Device: Not Specified

Re: Active RichText Field hyperlink not working

Thanks REXDOUG and Peter_Strange.  You guys rock!  

 

DEFAULT_MENU worked

 

I didn't quite understand the importance of the default menu.  For one thing, as a user, I hate when I cannot copy text.  I will be sure to be polite to the user and allow them to copy text that might be important to them.

Regular Contributor
Posts: 52
Registered: ‎11-29-2010
My Device: Blackberry 9700

Re: Active RichText Field hyperlink not working

I am facing the same problem. I am using the SCreen in which the stype has DFAULT_MENU | DEFAULT_CLOSE is attached. I am adding the ActiveRichTextfield on the screen. I am overriding the NavigationClick, written as onfocus is ActiveRichTextField, I am returning the super.navigationClick method. On clicking the enter key, the browser is opening perfectly. Nothing happends on clicking the field. It is going in side the method navigation click, and return super.navigationClick is working withhout any exception, but browser is not opening. Please help me.

New Member
Posts: 1
Registered: ‎09-19-2012
My Device: Curve 9360
My Carrier: Verizon Wirless

Re: Active RichText Field hyperlink not working

I'm sorry to sound dence....how do I add the DEFAULT_MENU style to my PopupScreen?


Thank you!