cordova.exec() is breaking my app code - javascript

I am developing an Ipad app with HTML5, Javascript/JQuery Mobile and Cordova/Phonegap. One of its features is to build and send an email, I am doing this using EmailComposer, the problem is that after the emailcomposer's screen runs and I return to the app, many of the list views (generated by Jquery Mobile) stop working.
Debugging I found that this happens when the function cordova.exec() runs. I tried to pass empty args, thought that maybe something were conflicting but the problem persists.
cordova.exec(null, null, "EmailComposer", "showEmailComposer", [args]);
Any idea of what could be causing this?

I don't think the issue is to do specifically with cordova.exec - that is just the method call for any native functionality.
Sounds more like part of your view is being redrawn and not getting enhanced by jQuery Mobile. You can trigger the create or refresh events on jQuery Mobile when you return to your app.
See the section on updating lists at the bottom of this page http://jquerymobile.com/test/docs/lists/docs-lists.html

I also faced the same problem, but now I solved it:
In "cordova.plist" write Key:EmailComposer and value:EmailComposer.
That's it!

Related

Trying to use Mobile Framework: Gliders in my web application

I'm currently trying to adapt my currently in-development jquery-mobile web application to use the navigational structure from this mobile template called Gliders, and I'm having some issues.
http://www.enableds.com/products/gliders/
I've been following their FAQ in order to incorporate the page structure, as well as the left sidebar in an attempt to get their navigational structure working, but I keep getting the following error in tons of my scripts:
$ is not a function
This is what was happening when I kept my current version of jquery in (which is 1.11.3); and when I switched to their version (which is 1.8.2), I get this error:
$(...).sketch is not a function
Though even if I comment my sketch functions out, the left sidebar isn't showing up at all.
Does anyone have experience with using templates like this?
Looks like it was because I was using a different version of jQuery than the version that was in the application.

Use part jQuery mobile only

I would like to use widgets from jQuery Mobile - buttons, drop down list, etc.
I already have a site that has been developed without the use of jQuery mobile, which has its own menus and links - and when I try to add jQuery mobile framework to it, it causes all sorts of problems (overrides CSS, tries to hijack page transitions, etc).
Is it possible to disable some features of the framework?
This is related to the question: Removing unused jQuery Mobile elements? - but it deals with minimizing the script size. I only want to disable certain functinality, so it doesnt interfere with the rest of my app.
Update: Part of the problem caused by using jQuery Mobile "as is" stems from the fact that it will attempt to load all links via ajax. It can be mitigated by adding rel="external" to links, so jQM won't attempt to load it via ajax.
There is a builder for JQM coming soon. As of 5/4/2012 its still in beta. Hang in there and the feature will be available any time now. I will try to update this answer when its released.
Update here is a link to the JQM builder http://jquerymobile.com/download-builder/
Adding the data-role="none" attribute to any form or button element tells the framework to not apply any enhanced styles or scripting
Building your package with only needed components is the first step that you should do but sometimes it is not enough.
There is also a piece of code which we found recently and used to stop loading jQuery Mobile panes on one page. This is very usefull if you want to use jQuery Mobile components separately without the framework itself. In other words, you still want to have a normal page behaviour (i.e. page reloads by clicking links) and use some jQuery Mobile components.
And here is this code that did a trick for our Symfony 2 project:
(function($) {
$(document).bind('mobileinit',function() {
$.mobile.ajaxEnabled = false;
});
})(jQuery);

Custom android spinner/picker

I'm trying to add an android-like spinner to my mobile website. To put everyone in context the site is access via a WebView in an android application not from the phone/tablet browser.
Now the problem is adding a nice jQuery android-like spinner or spawning a native control that looks something like this:
Follow this link for image. Image taken from my phone on the Google calendar app.
I really don't want the solution posted here.
For several reasons:
- the plus button on top and bottom looks awful
- doesn't apply for other types of spinners that I have such as states (FL, CA, etc).
- I might need one, two or three spinners depending on the case
All those conditions completely discard the native DatePicker and I don't know if it's possible to get rid of the + things in it to make it look like the image above. If the case, that wouldn't solve the problem for the state spinner.
We also have an iPhone version of the app and we use cubiq spinning wheel but i don't want iPhone look-n-feel for the android version.
Thanks!
This one looks like a promising solution but I haven't tried yet.
http://mobiscroll.com/

Multiple windows in one page for bookmarks

I want a single online web page for my bookmarks. The page should include small windows which opens the following pages:
Fizy, Facebook, Guardian.
There should also be a button for adding a new window with an URL text input.
Here's an illustration of how the page should look: http://i54.tinypic.com/2hrkb48.jpg
I've built a version of this at http://bit.ly/heqEd1, but as you may see, it uses iframes under javascript windows, which can not open frame-breaking sites (like fizy.com), or Facebook.
I'll make the research and but I am not sure how to proceed. Any solution will be accepted, like HTML5, XUL, Flex, AJAX or others. A solution with a local installation(like a Firefox extension) is not preferred, but still be ok.
Note: Piro Sakura has built a Firefox extension called split-browser. There's an element of the project called "subbrowser". An AJAX window that can show a subbrowser MAY solve the problem. I know the page will only be available from Firefox, but that is ok. (Again, a solution without an installation is preferred)
Any suggestions? How should I proceed? What should I learn? Is this possible?
Thanks.
I think you should use a Javascript with iFrames to do this. I'm not too sure what you're trying to accomplish with this, but it should be possible. As for which framework you'll use, it's up to you, but there will be a lot of custom code needed to implement this.
You can make multiple draggable windows in FLEX same as you have in you app
Please check sample as Starting point Movable/Draggable window and its demo
also u knows JS-DESKTOP lib with little customization to achieve that one of them are
jsdesk
sonspring-JQuery based
also you can do this using
Hopes that helps

What are some good pop-up dialog boxes for Ruby on Rails

I want to use modal pop-up windows in our web app in Ruby on Rails. Note that I don't want to create a new browser window, but a sub-window inside the existing webpage. We've tried things like TinyBox, but there are issues with returning error information from inside the controller. Any good method or tool that works well in ruby?
There's also prototype-window.
I've never used it myself (not yet at least) but have you tried RedBox?
I'm investigating ModalBox at the moment and it's looking promising.
There's a Google Group and Rails plugin which replaces the basic confirm popup with a modal dialog box.
Try TopUp! It is developed in a Rails application and you can get it from GitHub.
Please note that it is still beta. Feedback is always welcome ;)
Facebox, jquery, that Github use is the best one. There is also a prototype version.
I've used Lightbox Gone Wild for a while now, though I've modified it to display a DIV or other element that's already on the page (though hidden) and then return it to it's parent when the box is closed. I've used it make make Wizards that guide the user through a process.
I've used facebox_render for all my rails projects. It's really easy to use and provided complete helper. You can easily render html or javascript in your RESTful controller.
I have tried several of the ones mentioned above but after twiking it a bit I found that http://www.methods.co.nz/popup/popup.html works better for me, the only problem is that you have create an error routing similar to the one Rails uses, when returning to the popup window with errors the pop up window does not have a way to handle it

Categories