BlackBerry BrowserField executing javascript - blackberry

I tried a simple javascript [Example: document.getElementById("mydiv").style.display = "none";] on a web page and tested it on BlackBerry 4.5 simulator browser and it worked.
Now I have an app (JRE 4.5 - Eclipse Plugin) with a BrowserField embedded in a browser and I access the same page in the BrowserField. I do have the following code added to my app
myrenderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_ENABLED, true);
But the java script is not working. Do I need to add custom code to ensure java script executes? Anything in the Event.EVENT_EXECUTING_SCRIPT? Please help!

I simply can confirm I have the same code on OS 4.5 to enable JS, and the page with JS works OK for me. However should also say I don't hide anything on the page via JS, so I can't confirm if the same JS to hide an element works for me.
Also - I don't handle Event.EVENT_EXECUTING_SCRIPT in any way. So I am sure the code you are using to enable JS is enough to expect JS support in your BrowserField.

Related

smartgwt offline-caching with no GWT module

I'm using Eclipse 4.2, appengine-java-sdk-1.8.9, gwt-2.5.1, smartgwt-4.0p
I'm trying make the simple project like this - http://uptick.com.au/content/create-gwt-project
but offline.
When I save page (as html page) it doesn't work offline and I receive alert - "GWT module may need to be (re)compiled".
My question is: how to change project to save it as html page (plus project_name_nocache.js file).
Thanks.
You might be getting this error message because you might be trying to run/debug your application in compiled mode. In order to do so, you need to re-compile your application for GWT after every single change in code.
To avoid this, you should run/debug your application in developer mode.
See this link, to have idea on how to run GWT application in dev mode.

Meteor + jQuery Mobile + Phonegap

How to connect jQuery Mobile (meteor add ...)? I understand that you can connect by adding the head, but I do not want to.
I know about how to use Meteor + Phonegap, however, advise which option is better?
Outdated information:
jQuery-Mobile Meteor sample integration and/or integration guidelines
I created a new jQuery mobile (jqm) demo app at jqmdemo.meteor.com
because the "old" demo app (jqm.meteor.com) wasn't working as expected.
You can create a package in your local lib folder to use jqm in meteor (see source code on bitbucket, link is on the demo page).
There's no meteorite package for this at atmosphere yet (mrt add ...). I haven't created one, because I think there are still many things that can be improved in the demo (e.g. popups are not working in the demo).
Also event binding needs to be re-checked because I added the event to the rendered function of the templates with jQuery.on(...).
Attaching the jquery mobile events to the template.[yourtemplate].events({}) handler would be better, but I don't know how to do this.
I can not say anything to phonegap at the moment. Because I haven't tested it.
But at the moment I think that jqm and meteor is a bit slow in performance. If you have a look at the fontawesome-demo inside of the jqm demo you'll notice that it takes quite long to render the >300 icons. Maybe a server side rendering would be better, but I think that's not ready in meteor.

Reusing tabs in web browser

I am loading the given URL in web browser using the following code;
BrowserSession browserSession = Browser.getDefaultSession();
browserSession.displayPage(url);
Problem is, whenever I run this code, web browser opens the URL in a new tab (even if the URL is same). I want to reuse the existing tab or at least close the previously opened tab. In short I don't want to end up having a pile of tabs after firing several URLs.
Please guide me if there is any way to achieve this. I don't want to use BrowserField.
I am using;
BlackBerry Eclipse JDE 1.5
Target BlackBerry OS 4.5
Tested on BlackBerry Bold 9900 on Wifi network
I think the only one possible solution display pages inside your application by using BrowserField or RenderingApplication. There are samples available included to JDE or eclipse plugin.

jQuery Mobile v1.1.0 loader/progressbar do not show on android Internet browser

Hello I have problem with jQuery Mobile v1.1.0. When I try to use this function.
$.mobile.showPageLoadingMsg();
The progress indicator is not shown. The progress indicator(loader) is shown in regular browser, like FF, but in Android Internet browser, the PI is now shown. Do you have any Idea why the loader is hidden in android browser? I tested it on samsung nexus mobile phone, with the android version v2.3.4. I tried to call the function with parameters like this
$.mobile.showPageLoadingMsg("b", "test message test", false);
But this works only on my PC web browsers FF, Chrome IE etc.
did you try the examples in the docs?
On my android 2.3.3 the loader is shown but the loader image is not animated.
If the examples work for you, be sure that you replaced/removed all old JQM files with the 1.1.0 version (css, js, images) and that they are linked correctly in the document.
When the themeroller was deployed for v1.1.0 there was a small error with the loader images in the zipfile and the style sheet.
This was fixed within a few hours, but it might be that the version you downloaded tries to load ajax-loader.gif, while ajax-loader.png was in the zipfile.
Getting your theme again from the themeroller might fix it for you
Regards,
Casper
I had the same problem. The progress-dialog was not shown when doing an ajax call afterwards. I incapsulated everything except the showPageLoading-call in a timeout-function-call.
$.mobile.showPageLoadingMsg();
setTimeout(function() {
...[here your code goes]...
},200);
Worked for me although the animation only worked until the function has been executed (here: 200ms) but that doesn't really matter to me.

jQuery Mobile - error loading pages using PhoneGap and WP7.5 - issue with security?

I have an app that runs fine using android phonegap 1.2 and jqm 1.0, and I'm attempting to port it to windows phone 7.5.
When the index.html page loads, the first thing is does is use a $.mobile.loadpage to load another html page. all i get on the wp7.5 app is the 'error loading page' message flash up briefly. if i put an href to the page on index.html i get the same error. to summarise:
running the index.html in a desktop browser works
running the app on android works
running the app on wp7.5 without calling another page works
jqm in ie (on wp7.5) can load other pages
if i link to a public jqm site from within the app, the public site works (ie jqm will load pages that are located on the www)
i have put $.support.cors = true; in the js code to enable cross site xhr requests
it seems to me that the only issue is when jqm tries to load a local file via ajax. i assume this has something to do with default security settings in the webbrowser control that phonegap uses?
can anyone shed any light on this?
I suspect this is WP7's insistence that all pages loaded from the "local website" are actually loaded from IsolatedStorage.
In the newer Phonegap / Cordova WP7 project templates there is a file maintained per build, CordovaSourceDictionary.xml which will do this for you.
Just make sure that whatever files you want to be able to navigate to / load (yes, you have to do it for images too) have a Build Actiion of "Content" in your project and when you build it, this xml will be updated automatically.
When your app runs the first thing Cordova does on WP7 is go through all the files in this XML file and copy them to isolatedStorage so they can be loaded / navigated to.

Resources