07-09-2012 04:45 PM
Hi,
I have a problem with the combination of using Iframes or the HTMLObjectElement with any kind of blackberry.app.events. (onForegound / onBackground / onSwipeDown /etc.).
In the Ripple simulator all works fine but when I test it on the PlayBook the event only fires one time before I interact (click-event /etc.) with the iFrame. After the interaction the event doesn't work anymore.
I suppose that after the interaction with the iFrame the event fires to the iFrame-page and not to the parentpage.
Here some example code:
From config.xml
<access subdomains="true" uri="*"> <feature id="blackberry.app" version="1.0.0"/> <feature id="blackberry.app.event" required="true" version="1.0.0.0"/> </access>
From index.html - the swipemenu from the examples (not edited)
<script src="swipemenu.js"></script>
<script>
window.addEventListener("load", function() {
if(swipemenu) {
//Optional: override default menu height (default = 70px)
swipemenu.setMenuHeight(100);
//Required: Add menu buttons (can be text, images, or a mix of both):
// params (title, callback, alignRight, imagePath)
swipemenu.addButton("", doButton, false, "images/icon_options.png");
swipemenu.addButton("", doButton, false, "images/icon_reset.png");
swipemenu.addButton("Label", doButton, false, "images/icon_rules.png");
swipemenu.addButton("Text Only", doButton, true, "", "customIdStyle");
swipemenu.addButton("URL", doButton, true, "http://icons.iconarchive.com/icons/martin-berube/a nimal/48/monkey-icon.png");
swipemenu.addButton("[x]", swipemenu.close, true);
/*
icon_options.png, icon_reset.png and icon_rules.png (Public Domain) courtesy of Rory Craig-Barnes
https://github.com/glasspear/WebWorks-CodeSamples
monkey-icon.png (Freeware, allowed commercial usage) courtesy of Martin Berube:
http://www.iconarchive.com/show/animal-icons-by-ma rtin-berube/monkey-icon.html
*/
}
}, false);
</script>
From index.html - iFrame-Example
<iframe frameborder="0" scrolling="no" src="http://localhost:49646/Login.aspx" name="window" class="iframeMain" width="1020" height="575" >
I have test it also with the HTMLObjectElement and the result was the same.
I hope, someone of you have a good idea to help me with the solution of the problem.
Thanks a lot. Greetings from Germany.
Moritz
Solved! Go to Solution.
07-10-2012 03:34 AM
A Short addition:
I am also open for some other solutions to integrate external content form an Asp.net-Page in the Webworks-Application without using Iframes or the HTMLObjectElement.
Thanks for advising,
Moritz
07-10-2012 12:44 PM
The following, in your config.xml file, is invalid. You cannot whitelist features against all domains using the wildcard * character:
<access subdomains="true" uri="*"> <feature id="blackberry.app" version="1.0.0"/> <feature id="blackberry.app.event" required="true" version="1.0.0.0"/> </access>
You will need to define each domain that can be rendered within your iFrame, and enable access to the WebWorks APIs like so:
<access subdomains="true" uri="http://mydomainABC.com"> <feature id="blackberry.app" version="1.0.0"/> <feature id="blackberry.app.event" required="true" version="1.0.0.0"/> </access> <access subdomains="true" uri="http://mydomainXYZ.com"> <feature id="blackberry.app" version="1.0.0"/> <feature id="blackberry.app.event" required="true" version="1.0.0.0"/> </access>
I see that our documentation on this subject does not make this clear. I will ask the docs folks to update that page.