02-25-2010 02:00 AM
I am using Visual Studio 8 with the latest Sun Java and the beta 2 of the plug-in. I am using 32 bit Windows 7... I know this isn't directly supported, but it does appear to be working for the most part and I don't have an XP or Vista machine available to me.
I have been able to make most of the sample applications work. I can directly browse my .net web site. I have another post about not knowing where the commands are.
I understand that displaying pages is different. I set up some simple links on the index.htm page in the widget I am building. i.e.
These are inside the <body section of the index.htm widget. While I can retreive the pages all of the css styles are stripped and it is raw and I get render errors. Is there some way to retrieve pages from outside html resources and not lose the css style formatting? Will one of the 5 browser models work better?
a href="http://xxx.xxx.x.x/Trade/SPLogin.aspx">Link</a> a href="http://finance.yahoo.com">Link2</a>
Thank you in advance,
Solved! Go to Solution.
02-25-2010 07:45 AM
In order to bring in outside resources into your Widget, you will need to white list their full domain. For example http://www.blackberry.com.
This can be done in the config.xml editor where you can add domains that are white listed to your widget. This includes any images, css, htm, js or any other resource for your widget.
If you want to pull data from a URL behind the scenes you can use standard AJAX calls.
02-25-2010 12:10 PM
thank you.... the window.location.href property suggestionhelped tremendously
I already had my rmote site whitelisted in the widget config.xml. So that wasn't my issue.
Even with the window being redirected to the remote web site page.... it still shucked the CSS property formatting.
Sorry to bother you. Your suggestion on setting the window.location.href property took me a long way to where I want to go with this application. I do have several more related questions if you could please help:
Environment: 32-bit Windows 7, most recent Java development environment from Sun, Visual Studio 8 most recent BlackBerry Beta Plug-in, 9700 Simulator working fine, whitelisted remote .NET/ASP/SQL Server 2008 to use as remote formatted page server, XMLHTTP requests, and possibly direct .asp service calls.
1) When inside the Visul Studio Plug-in is it really making XML requests rater than a page request even when you are setting the window.location.href property?... which would mean it is only returning raw page data and no CSS style formatting.
2) Also, I had trouble for almost a whole day yesterday when calling/linking to my non Smart Phone remote web site login page... it kept giving an error in the widget plug-in environment "Error encountered during XML parse: Expecting '>'." The culprit turned out, after not being able to debug directly, to be comments i.e.. "<!-- " in my ASP pages. It can't seem to deal with this standard comments format and I believe it thinks it is part of the XML. Which is also why I am starting to believe this is not a true invoke of the BB browser application.
Would I be better off invoking a browser session from within the Widget to get a formatted page from the remote site if that is for example what I want part of the widget app to do rather than reinvent all the CSS etc in the widget application?
5) I have seen many posts about HTML Tables... I have the impression that HTML Tables are a dirty word in the Smart Phone world. I noticed in the native/9700 simulator browser application my site retains the CSS, but I have the usual problems with smart phone browsers i.e.. postbacks don't work, etc. It seemed like when I first started browsing my remote .NET/ASP web site a few days ago the formatted HTML tables were showing up. After the installs and reinstalls now it seems to have gone away. So I have started making a Smart Phone version version of my web application that cuts the size down, uses click events, etc. Is there some quick setting change that will show an HTML table in the BB browser application that I can make?
I know this is way beyond ... usually a reporter only gets to ask two questions and I am asking 7 new ones. Just the one word from your previous post "location.href" took me a long way, so I hope you can take the time to give me a piece of advice on each one above.
Thank you again,
02-25-2010 12:47 PM
if you see this before my other post, you can ignore question #2. After your other post pointing me to the API reference I tried the blackberry.invoke.BrowserArguments imy widget and it leaves the application and starts an independent browser session from the widget. This could get me going at least to have a simple widget/package that does nothing more than point to a more Smart Phone browser friendly version of my web application, but I would miss other things I want to do i.e. push notifications to my widget application from the server, use the BlackBerry menus etc. for application navigation.
So, while it is painfull, I guess no pain no gain. My other questions are still relevant about bringing CSS formatted tables in from the server into the widget plug-in application etc.
02-25-2010 12:51 PM
If you set the location.href property it will navigate to another page and not just pull in an XML request.
BlackBerry Widgets support the standard XMLHttpRequest just like Chrome or Firefox, and all of its functions and properties. Some AJAX examples can be found here:
03-23-2010 06:48 AM
By "Navigation" I think you are referring to bringing in an outside page into your widget... If you have properly white listed your full domain then it should bring in the content. Also if your target resource performs a re-direct to another domain, you will have to also white list that other re-directed domain.
Can you post your <access> element and also the desired URL you are trying to bring in?
There is also a tutorial here: