[Zope] handling SELECT 'onchange'

Jim Anderson ezjab at ieee.org
Mon Mar 1 15:33:44 EST 2004


Jonathan,

I spent a good part of the weekend and today experimenting with DTML 
files laced
with javascript. I made quite a bit of progress, but I can't get past a 
basic communication
problem between the javascript environment on the client and the Zope 
server environment.

My current problem is that I'm trying to pass information from js to 
Zope and I'm doing
it through an external method that is called as an action on a form. The 
client side
is putting up a form with a selction in it. The selection determines 
what the next
frame to be posted will be and js procedes to start posting the next 
frame. The
action on the submitted form passed the choice back to the server, and the
choice is used by the server to insert information about the choice into the
next frame that js is trying to put up in the window. The logic works 
sometimes,
sometimes it doesn't. It looks to me that the code is in a race condition
whether it can get the choice information back to the server before the 
server
sends the next frame to the client side.

To fix my problem, I need to be able to block js from running while the 
server
gets updated. But I don't see anyway of doing this in javascript.

So my real question is, "Is there anyway using javascript to get coordinated
communication between the client and server to assure that client and
server process can be synchronized when required?"

I can definitely work around this issue, but my resulting web pages will
be less configurable and will require greater maintenace. I appreciate
you thoughts or anyone elses thoughts.

Jim


Small Business Services wrote:

>From: "Jim Anderson" <ezjab at ieee.org>
>
>>Thank you, Jonathan. Your response does help some. I have a follow up
>>question, being a newbie.
>>
>>
>>How does information get passed from javascript back to the
>>my server side environment when using Zope? Just a pointer
>>on where to look will be helpful.
>>
>
>You have to use javascript to insert the variable into a form element which
>will then be returned to zope.
>
>There is a really good tutorial on javascript and how it relates to the
>Document Object Model (DOM) at:
>http://www.quirksmode.org/js/
>
>If you are a zope newbie, but have some programming skills then this
>shouldn't be a problem.  However, if you are not a programmer-type I would
>stay away from this (when you start playing with javascript you have to
>start worrying about supporting various web browsers - eg. Explorer,
>Mozilla, Opera, Safari, Netscape, etc - which can be easy or really complex
>depending on how much functionality you put into the javascript).
>
>If you decide you are not going to pursue the javascript option, post your
>problem on the list and maybe someone can address your specific issue.
>
>HTH
>
>Jonathan
>
>






More information about the Zope mailing list