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

Web and WebWorks Development

Reply
New Developer
MS-BMB
Posts: 8
Registered: ‎03-20-2012
My Device: Torch 9810, PlayBook
My Carrier: T-Mobile
Accepted Solution

blackberry.app.event - Working with iFrames / HTMLObjectElement

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/animal/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-martin-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 

 

 

Please use plain text.
New Developer
MS-BMB
Posts: 8
Registered: ‎03-20-2012
My Device: Torch 9810, PlayBook
My Carrier: T-Mobile

Re: blackberry.app.event - Working with iFrames / HTMLObjectElement

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

 

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: blackberry.app.event - Working with iFrames / HTMLObjectElement

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.

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.