[Twisted-web] Error: nevow_clientToServerEvent is not defined (Firefox JS Console)

Uwe (Peter) Feldtmann uwe at microshare.com.au
Wed Jun 29 21:54:24 MDT 2005


Does the current svn checkout handle XUL?

I've tried playing with it with mixed results.

I need to send updated values to client fields and later to bring em 
back. I've included slightly hacked versions of xul_nevow.py and 
xul_example.xul  The label change works as expected but I'm not handling 
the text fields properly.

Can someone please nudge or kick me in the right direction?

Donovan Preston wrote:
> 
> On Jun 29, 2005, at 2:32 AM, Michael M wrote:
> 
>> Firstly, I love nevow, brilliant design, really just plain brilliant.
>> Thanks in advance for any help with this problem.
>>
>> # PROBLEM
>> The livepage/evil example failes with this error in the Firefox JS console
>>
>> # ERROR
>> Error: nevow_clientToServerEvent is not defined
> 
> 
> Sorry, that example is way out of date. livepage is still under heavy 
> development and has changed a lot in the last year or so. It has even 
> changed a lot since the last release (0.4.1). If you would like to use 
> livepage, I suggest you get a svn checkout of:
> 
> svn://divmod.org/svn/Nevow/branches/dp/livepage-completion-notification-3
> 
> I have attached a simple example which works with this branch.
> 
> I hope to have livepage stabilized by the 0.5 release (bugfixes 
> notwithstanding). There is still quite a bit of work to be done before 
> this will actually happen though.
> 
> The reason nevow_clientToServerEvent was not defined in your tests is 
> because the javascript which defines it was never included in the page. 
> In the below example, you'll notice two render directives, one invoking 
> "liveid" and one invoking "liveglue". The liveid is a fragment of 
> javascript which embeds a unique id in every rendering of a LivePage. It 
> changes every time the page is rendered. The liveglue is a fragment of 
> javascript which never changes. It is separate from the liveid to allow 
> you to have one global location for the liveglue javascript which every 
> page references, to take advantage of browser caches.
> 
> The other difference with this example is the ease of calling a 
> server-side function from javascript. Once the liveglue javascript has 
> been included in a page, there is a global "server" object which has a 
> "handle" method. The javascript in the example below was written by 
> hand, not generated automatically by the nevow page rendering process. 
> This makes it easier to hook up client-side event handlers to server 
> side methods.
> 
> One final difference in the example below is that now server-side event 
> handlers can return javascript which will be evaluated in the browser. 
> Previously, you had to make calls on the ClientHandle object to send 
> scripts to the browser (which you can still do if you need to). The new 
> architecture instead renders the result of a server-side handler in a 
> JavascriptContext. This means all the rendering advantages Nevow 
> provides for HTML are also possible with JavaScript now (rendering 
> generators, rendering multiple deferreds, much safer quoting, etc.)
> 
> Hope all this helps.
> Donovan
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xul_example.xul
Type: application/vnd.mozilla.xul+xml
Size: 1874 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050630/9a8d99b1/xul_example.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xul_nevow.py
Type: application/x-python
Size: 901 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050630/9a8d99b1/xul_nevow.bin


More information about the Twisted-web mailing list