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: 52
Registered: ‎05-31-2012
My Device: Not Specified
My Carrier: Airtel

how to send data using post method in browser field

Hi,

 

 i need to open a webpage in browserfield by post hit.I need to send some data with url.How to do that.

Developer
Posts: 78
Registered: ‎05-17-2012
My Device: 9900 - OS 7.0 Torch device
My Carrier: Reliance

Re: how to send data using post method in browser field

Hi

 

To have webview, you may need to use the below

BrowserSession bs = Browser.getSession(Browser.CID_BROWSERCONFIG);
        

public void displayPage(String url,
                        String referrer,
                        HttpHeaders requestHeaders,
                        PostData postData)
here url would be your base url, you can add the postdata
Developer
Posts: 52
Registered: ‎05-31-2012
My Device: Not Specified
My Carrier: Airtel

Re: how to send data using post method in browser field

Hi 

 

I have open webpage successfully by post method below is my code

 

final HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.addProperty(
HttpHeaders.HEADER_CONTENT_TYPE,
HttpHeaders.CONTENT_TYPE_APPLICATION_X_WWW_FORM_URLENCODED
);

final URLEncodedPostData postData =
new URLEncodedPostData(URLEncodedPostData.DEFAULT_CHARSET, false);

postData.append("key", "value");


BrowserSession browserSession = Browser.getDefaultSession();
browserSession.displayPage("MYURL",
null, requestHeaders, postData);
browserSession.showBrowser();

 

 

 

But i need to open this page in browser field.

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: how to send data using post method in browser field

Hi,

 

Check this - 

http://supportforums.blackberry.com/t5/Java-Development/Need-to-open-Browser-field-with-post-method-...

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 52
Registered: ‎05-31-2012
My Device: Not Specified
My Carrier: Airtel

Re: how to send data using post method in browser field

I want to open the webpage in internal browser, not in externel browser.

Developer
Posts: 78
Registered: ‎05-17-2012
My Device: 9900 - OS 7.0 Torch device
My Carrier: Reliance

Re: how to send data using post method in browser field

Can you please be more explanative. You want to open the web page with in your application like WebView rt. If so, there is no need to go for BrowserField

Highlighted
Developer
Posts: 52
Registered: ‎05-31-2012
My Device: Not Specified
My Carrier: Airtel

Re: how to send data using post method in browser field

BrowserSession open the webpage in default web browser of device, but i does not want to open my page in any browser, It should  show like other pages of app.