PDA

View Full Version : Multi-frame LZX application


andys
03-28-2003, 12:41 AM
I'm experimenting with a Laszlo application that runs in a multi-frame layout. The overall layout is a left-side window presenting a control bar, a right-side top window with another control area, and a right-side bottom display area presenting HTML. Like so:

-----------------------------
Left | Top-Right
Side | control bar
|-----------------------
Ctrl |
bar | Bottom-Right
| display area
|
| Shows full HTML pages
|
------------------------------

What I want is the two control bars to be one application (that is, an application that can share javascript objects).

If I could display a full HTML page inside an LzView, then I'd be set. In that case I'd make the whole area one LZX app use LzView to control where the HTML content displayed. But I don't believe I can do that at all. I'm under the impression that the lower-right area will have to be a frame in a browser frameset if I am going to display pure HTML there.

If that assumption is correct, then it seems I would have to load two completely independent LZX applications in each of the left and top frames.

Can those applications share any common underlying environment (as in javascript runtime environment)? If not, what techniques can I use to communicate between these two different windows? Or is there some other way to go about building something like this?

Thanks.

Andy

antun
03-28-2003, 06:56 AM
Hey Andy

I could be wrong here, but I don't believe they can intereact. Client side Javascript <-> client side Flash Player doesn't really work. You can call scripts on an HTML page using LzBrowser.loadURL( 'javascript:...' ), but I don't believe it's possible to get browser JavaScript from the wrapper page to communicate to the Flash runtime.

I guess you could establish a persistent connection going via the server between the two LZX apps, but that sounds like it's going too far for what you want to achieve.

-Antun

andys
03-28-2003, 08:44 AM
Antun,

I think I may have misused the term javascript. I am NOT talking about native browser javascript talking to the LZX flash app. Rather, I am talking about two LZX apps (or much better, one LZX app) running in two different browser frames. When I said javascript what I meant was the methods, attributes and variables of an LZX application.

I think what I'm asking would be a not-too-uncommon desire. That is, using an LZX application (or applications) in more than one browser frame at the same time. Might this not be a common way to combine normal HTML display with LZX-based display?

What I thought you might suggest is that sharing a common dataset was the way to go (though I was hoping for tighter integration). But I want to make sure I've communicated the problem set clearly before I start asking more questions!

Andy

antun
03-28-2003, 01:01 PM
Hey Andy

I wasn't sure if you were talking about LZX or browser JavaScript, but still you can't get one lzx app in one frame or window to talk to another one. In theory you'd have to have one app post updates on the server, and the other app update when an update was made! Sound confusing?

You can't share a dataset from two separate apps.

-Antun

andys
03-29-2003, 11:13 AM
As a matter of fact, I was looking into using an LzConnectionDatasource to do just that. I spent a while walking through the Chat example, but it's left me with more questions that answers!

Does one have to "log in" to use a connection datasource? How might I generate a browser-unique user name such that message are exchanged between the two windows in the same browser only? Is this even a sensible way to accomplish my goal?

I decided the amount of time I'd have to play around with the Chat code to get at the answers was more than I'm willing to put in now.

If you have any other examples or documentation of the basic LzConnectionDatasource methods then I might look further. Otherwise I think I've hit a dead-end here, at least for now.

Andy

Grig
03-29-2003, 12:15 PM
Flash does it this way: http://www.macromedia.com/support/flash/ts/documents/flash_to_flash_comm.htm

Looks like it may be possible through LZX?