Yes. There can only be one history location per page (there's only one address bar), so the current system broadcasts to all apps on the page.

Philip Romanik wrote:
Approved!

When I ran the /test/history demo, the Next/Prev buttons seem to affect all 3 apps. Is this expected?


Change 20080511-maxcarlson-A by [EMAIL PROTECTED] on 2008-05-11
10:27:28 PDT
     in /Users/maxcarlson/openlaszlo/trunk-clean
     for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix history and swf embedding to support multiple apps on the same page New Features: Bugs Fixed: LPP-5980 - Browser integration only supports a single flash application Technical Reviewer: promanik
QA Reviewer: hminsky
Doc Reviewer: (pending)
Documentation: Release Notes: Details: test/history/index.jsp - Update to use new APIs, embed a swf8, swf7 and dhtml app simultaneously. test/lfc/legals/testjscomm/test6.jsp - Embed two copies of the app - ensure the swf7 version is loaded. Add automated tests that alert if there are problems. test/lfc/legals/testjscomm/test8.jsp - Embed two copies of the app. Add automated tests that alert if there are problems. test/lfc/legals/testjscomm/copy-of-hello.lzx - Test early calling with
callJS()
test/lfc/legals/testjscomm/test.js - Shared include of unit tests for test6.jsp and test8.jsp. kernel/ewf/dojo/flash6/DojoExternalInterface.as - Add _id field so the DojoExternalInterfaceClass instance can track the app it's talking with. Set _id in the constructor. call() uses a separate _fsreturnResult field for method call results to prevent clobbering by _handleJSCall(). Switch to a dummy default for _fsreturnResult to ensure null return values are captured. Delay call to LzBrowserKernel.__jsready() to ensure queued calls from the runtime don't happen too early. Comment out unused stuff. kernel/swf/dojo/flash8/DojoExternalInterface.as - Add _id field so the DojoExternalInterfaceClass instance can track the app it's talking with. Set _id in the constructor. addCallback() and loaded() refer to _id to communicate with the right app. kernel/swf/LzBrowserKernel.lzs - Remove unused _jsreset(),
receivedHistory() and related methods/calls.
kernel/swf/LzSprite.as - Use LzHistory.__start() API instead of setting the isReady field directly. kernel/dhtml/LzSprite.js - Use LzHistory.__start() API instead of setting the isReady field directly. kernel/dhtml/LzBrowserKernel.lzs - Remove unused receivedHistory() method. kernel/swf9/LzBrowserKernel.lzs - Remove unused receivedHistory() method. services/LzHistory.lzs - Mark isReady attribute deprecated - use onready event instead. receiveHistory() and receiveEvent() call setAttribute() instead of setting properties and sending events directly. Add __start() method to be called by the canvas sprite. LaszloLibrary.lzs - Pass app ID into DojoExternalInterfaceClass() constructor. includes/ - Remove unused 3.x versions of embedding code/sources. includes/source/embednew.js - Fix errors in docs. Warn if two apps with the same id are embedded into the page. Store a reference to the app by id in Lz and Lz.applications. _setCanvasAttributeSWF(), _getCanvasAttributeSWF(), _callMethodSWF and _loaded() use dojo.flash.comm[appid] to call a specific app. Remove Lz.loaded property. Calls to browser Lz[appname].onload() method pass a reference to the app. Lz.setCanvasAttribute() and Lz.callMethod() now broadcast to all apps embedded on the page. includes/source/lzhistory.js - init() expects a reference to the app that history is being enabled for. Eliminate unnecessary test in _checklocationhash(). _parse() walks the list of registered apps and sends history events if they are loaded and haven't received the current history value. _store() takes an optional hash to set several canvas attributes with setCanvasAttribute({name: value...}, null, true). Remove unused __receivedhistory() method and rely on return value in __setFlash() instead. includes/source/flash.js - Keep default values in a separate defaults hash. Set app properties in setSwf() based on a hash of values passed in, overriding defaults. useFlash6() and useFlash8() expect an id to look up the correct application and init properties. addLoadedListener() and addInstallingListener() expect scopes for callback methods. loaded() expects an id so it can look up the appropriate scope for listener callbacks. _initialize() uses a hash of properties and registers a unique dojo.flash.obj[properties.id] and dojo.flash.comm[properties.id] by app id. dojo.flash.Embed class uses properties hash instead of explicit arguments. dojo.flash.Communicator class registers app id for callbacks to be sent to the right app. dojo.flash.Install class registers app id for callbacks to be sent to the right app. Tests: test/lfc/legals/testjscomm/test8.jsp and test/lfc/legals/ testjscomm/test6.jsp run without warnings in Firefox, Safari and IE 6/7. test/history/ passes with all 3 runtimes at the same time. lps/ components/extensions/test/html.lzx runs well in dhtml, swf7 and swf8. Files:
M      test/history/index.jsp
M      test/lfc/legals/testjscomm/test6.jsp
M      test/lfc/legals/testjscomm/test8.jsp
M      test/lfc/legals/testjscomm/copy-of-hello.lzx
A      test/lfc/legals/testjscomm/test.js
M      WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as
M      WEB-INF/lps/lfc/kernel/swf/dojo/flash8/DojoExternalInterface.as
M      WEB-INF/lps/lfc/kernel/swf/LzBrowserKernel.lzs
M      WEB-INF/lps/lfc/kernel/swf/LzSprite.as
M      WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
M      WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs
M      WEB-INF/lps/lfc/kernel/swf9/LzBrowserKernel.lzs
M      WEB-INF/lps/lfc/services/LzHistory.lzs
M      WEB-INF/lps/lfc/LaszloLibrary.lzs
D      lps/includes/vbembed.js
D      lps/includes/h.swf
D      lps/includes/embed.js
D      lps/includes/h.html
M      lps/includes/source/embednew.js
M      lps/includes/source/lzhistory.js
D      lps/includes/source/history.as
M      lps/includes/source/flash.js
D      lps/includes/source/h.fla
M      lps/includes/source/iframemanager.js
M      lps/admin/dev-console.lzx
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080511-maxcarlson-A.tar

--
Regards,
Max Carlson
OpenLaszlo.org

Reply via email to