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
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel
Accepted Solution

Active RichText Field Hyperlink issue

Hi,

 

I am writing a URL in Active RichText Field. After clicking that, it is hitting the server and coming back to my app. But after coming back also it is displaying the open link menu item. I have implemented the navigation click. How can i remove the menu items or popups while clicking.

 

Here is my code:: 

 

		mCrtHyperlink = new ActiveRichTextField("url")
		{
			int color = Color.BLUE;
			protected void onFocus(int direction) {
				color = Color.GREEN;
				invalidate();
			}

			protected void onUnfocus() {
				color = Color.BLUE;
				invalidate();
			}
			
			protected void paint(net.rim.device.api.ui.Graphics g) {
				g.setColor(color);
				super.paint(g);
			}
			
			protected boolean navigationClick(int status, int time) {
				// TODO Auto-generated method stub
				
				Browser.getDefaultSession().displayPage("http://otp.arcot.com");
				UiApplication.getUiApplication().invokeLater(new Runnable() {
					
					public void run() {
						// TODO Auto-generated method stub
						Logger.out("ProvisionForm", "Before Perform Action");
						performOkAction();
					}
				});
				return super.navigationClick(status, time);
			}
		};

 Help me in this matter..

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

Re: Active RichText Field Hyperlink issue

Not tested, but as per the documentation, you should return true from a navigationClick if you handle the method.  You do, so instead of

return super.navigationClick(status, time);

I suggest you just code

return true;

 

I think that will resolve your problem.