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
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve

browserfield hyperlink problem

I am opening an url in the browser field(internally) . Now this browser field is having a link (a facebook button)which has to open a new browser feild...Can any on tell me how to extract that link url so that i can open that one in another browser field from my application.

Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: browserfield hyperlink problem

[ Edited ]

it can be done through BrowserFieldListener
do some thing like this:

public void documentCreated(final BrowserField browserField, ScriptEngine scriptEngine, Document document) throws Exception
{
       String tempUrl = browserField.getDocumentUrl();
       newBrowserField.requestContent(tempUrl);
}

 You want to stop previous page from loading?

 

Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: browserfield hyperlink problem

dont know it happen or not try using:

if(!browserField.back())
{
    Status.show("No Page Available....");
}

 use this in create document it make ur previous browserfield to its last opened page may be that is the page from where u click the link, i havent tried it yet? hope this one works for you? Good Luck

Developer
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve

Re: browserfield hyperlink problem

no...once the first page is loaded (using this code ...)

_bf2.displayContent(data, "http://localhost");

 

 

the facebook button is there in that first page.When i am clicking on that

button it is not responding ...actuall it has to open a new external browser field Where we will find the

user login page of facebook

Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: browserfield hyperlink problem

dont have knowledge about this try adding listener and see whether url is changes or not on button click
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: browserfield hyperlink problem

In my experience, the BrowserFieldListener is too late for listening for this sort of thing.  Have a look at this Thread, does not appear to be directly related but the same issue is being addressed:

http://supportforums.blackberry.com/t5/Java-Development/Browserfield-generates-Internal-Server-Error...