08-24-2008 11:11 PM
Hello again'
Have a good day'
So, I am using ActiveRichTextField object for my application. I think argument of the construction method is required initial value. For instanse :
ActiveRichTextField field = new ActiveRichTextField("http://www.google.com"); // create object
add(field);
For my application, initial value is too long. So, I need to become this long URL to label.
That is to say, label of "http://www.google.com" is "Google". When I click "Goolge", go to "http://www.google.com" in the browser.
How to solve it ? Plz help me guys'
Solved! Go to Solution.
08-25-2008 01:11 AM
Override LabelField class. This class reacts on Trackwheel click.
You may set an arbitrary label, say "Google Inc." and an arbitrary http link, say: "http://www.microsoft.com"
public class MyLinkField extends LabelField { ...... private final String httpLink; public MyLinkField(String label, String httpLink){ super(); setText(label); this.httpLink = httpLink; } protected boolean trackwheelClick(int status, int time) { // if http link is set if (httpLink.length>0) { // opening link in browser BrowserSession browserSession = Browser.getDefaultSession(); browserSession.displayPage(httpLink); } } }
08-25-2008 01:57 AM
Tnx for ur response Rafo. It is solution to solve my problem. But BrowserSession is "Signed Class".
Is there any way to solve this problem by NOT using SIGNED classes ?
Tnx man
08-25-2008 02:14 AM
I am not sure that's possible to solve this task without use of classes which require signing.
It may be a serious obstacle if you're working on an open source project.
In other cases - you may purchase signature keys from RIM (just $20 for unlimited use).
08-28-2008 06:06 AM
Hello guys'
I researched ActiveRichTextField class. It has a method that named executeBackgroundScan(). I think this method works in background when push on active text displayed on the screen. If it is right, maybe we can work it background of LabelField. I tried to work it, but couldn't do. Because this method is defined by "protected" syntax.
Now I don't know how to solve this problem. Do you have any idea to solve ?
I haven't good experience for Java programming. And sorry for my bad English.
Tnx in advice'
08-28-2008 11:04 AM
Launching the browser from a third party application does require the user of signed APIs. There isn't a way around that requirement. You'll need to purchase a set of signature keys using the form here:
http://na.blackberry.com/eng/developers/downloads/
08-28-2008 09:53 PM
Ok, Tnx Rafo, tnx Mark Sohm. I got ur ideas'
Tnx again'