<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2656.27">
<TITLE>Problem using LivePage/javascripts/event handlers</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2 FACE="Arial">I'm a relative noob to Twisted and Woven, but I'm trying to use them to serve some dynamic web content without success. There's two spots that I am most interested in:</FONT></P>

<P><FONT SIZE=2 FACE="Arial">When I include</FONT> <FONT FACE="Courier New">&lt;span view=&quot;webConduitGlue&quot; /&gt;</FONT> <FONT SIZE=2 FACE="Arial">in my xhtml file, the browser will spin its wheels forever. A big empty box is displayed at the bottom of the browser window and the browser status displays</FONT> <FONT FACE="Courier New">Transferring data from &lt;myIP:port&gt;</FONT> <FONT SIZE=2 FACE="Arial">... . This behavior is consistent on Mozilla (I'm on Red Hat Linux OS) and on the latest Netscape (7.1). I checked to make sure javascript options were turned on in Netscape. Here is the Code:</FONT></P>

<P><B><FONT SIZE=2 FACE="Arial">Xhtml file:</FONT></B>
</P>

<P><FONT SIZE=2 FACE="Arial">&lt;html&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp; &lt;head&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title&gt;generic&lt;/title&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp; &lt;/head&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp; &lt;body&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;table model=&quot;listdata&quot; view=&quot;listdatatable&quot;&gt;&lt;/table&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;span view=&quot;webConduitGlue&quot; /&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp; &lt;/body&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&lt;/html&gt;</FONT>
</P>

<P><B><FONT SIZE=2 FACE="Arial">Key Python/Twisted code:</FONT></B>
</P>

<P><FONT SIZE=2 FACE="Arial">class Epage(page.LivePage):</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; ...</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; def initialize(...):</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.someListData = [['a', 'b', 'c'],</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ['d', 'e', 'f'],</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ['g', 'h', 'I']]</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; def wmfactory_listdata(self, request):</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.someListData</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; def wvupdate_listdatatable(self, request, node, listdata):</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = lmx(node)</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d = l.div()</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t = d.table(border='0', cellspacing='2')</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.tr(bgcolor='eeeeee')</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for arow in listdata:</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.tr()</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for entry in arow:</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.td().text(entry)</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.td().form().input(type='button', value='REMOVE', view='rmExercise')</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp; def wvupdate_rmExercise(controller.Controller):</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def initialize(self):</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.view.addEventHandler(&quot;onclick&quot;, self.onClick)</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.view.addEventHandler(&quot;onmouseover&quot;, self.onMouseOver)</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def onClick(self, request, widget):</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print self, &quot;CLICKED!&quot;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def onMouseOver(self, request, widget, argument):</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print self, &quot;MOUSE OVER!&quot;, argument</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">The browser will draw me a table with buttons, but these events don't seem to get processed. So that brings me to the second trouble spot I am interested in. For those who know, am I embedding buttons in my table in an acceptable manner? Am I trying to handle events correctly? If the xhtml webConduitGlue was working would my event handling work? Please feel free to criticize any part of this code. Thanks,</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Matthew</FONT>
</P>

</BODY>
</HTML>