[Zope-dev] Re: [Zope] Javascript wizards wanted for Zope project

Phillip J. Eby pje@telecommunity.com
Tue, 16 Nov 1999 22:00:14 -0500


At 11:45 AM 11/17/99 +1000, Anthony Pfrunder wrote:
>
>The problem is: how do I get a form to talk to an object in another frame?
>ie:
>
><input value=".." ... onchange="mywidget.setAttribute('property',
>value-of-inputbox)>
>
>where mywidget is a javascript function defined in another (loaded) frame.

top.otherFrameName.objectName.method()


>Also, how can I "call" a html page without causing a reload:
>
>function jsZDOMsetAttribute(name, value){
>  call("getWidget/setAttribute?name=name&value=value")
>}

Create a "hidden" frame, i.e., one that is either zero width or zero
height.  Set the document.location.href of this frame to the URL you want
to call.  Note that this is asynchronous, however, and to find out if the
page has been loaded, you'll need to make that page have an onLoad function
to call back the original frame and say it's loaded (if you need it to do
that).  Depending on the complexity of your app, you may want/have to also
have the caller implement a timeout to catch errors, and/or set up your
Zope error page to have Javascript in it that signals an error back to that
page.  (Whew.)