Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Webview Widget Asset Javascript Reference

$
0
0

SDK 3.5.0.GA - iOS emulator (iphone 5)

I am playing around with a widget that uses webview as the main component.

the only thing the widget controller does is to load a page in the widgets asset directory

$.webpage.url = WPATH('index.html')
in the assets dir is a very simple local html file and a javascript file that the html page references.

And this all seems to work fine.

The problem comes when I put 2 widgets on the same window ( in this case on index.xml just for testing)

It seems that when the widget is created it loads the html file in the assets dir OK, but although a new widget is created it does not create a new version of the html page it actually loads a reference to the same page or at least the same javascript context ( i.e. once the assets are loaded in memory for one widget they are then referenced not loaded again for each new widget)

The upshot is that 2 widgets are displayed but the javascript routine only acts on 1. It's almost like I need to load a clean version of the asset files for each instantiated widget which does not seem to be the default case.

Silly question perhaps, but am I doing something wrong or is this actually expected behaviour?

I an currently trying to cut down my code to be able to show a simple example of the behaviour that I am seeing, but wanted to just ask the question first in case there is a simple answer.

Thanks.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>