[Twisted-web] athena widgets and IE

Fabio Forno fabio.forno at gmail.com
Wed Oct 11 17:19:04 CDT 2006


On 10/11/06, Jean-Paul Calderone <exarkun at divmod.com> wrote:

> It's better to not use getElementById.  Instead, make the chat area node
> a child of the ChatWidget's node and find it either by class or using the
> new Widget.nodeById method.
>

I'm using trunk, but I can't find it. Anyway in the handler I've no
problems in getting references to the items of the page, instead it's
the reference to handler that makes problems.

> Likewise, "athena:1" is an implementation detail, and you can't rely on
> your widget getting id "1" all the time.

Yep, this was only a quick shortcut for doing a test trying to have a
ref to the handler.

> Instead, try using the
> athena:handler feature:
>
>     <div nevow:render="liveFragment">
>       ...
>       <textarea>
>           <athena:handler event="onkeypress" handler="keyPressed" />
>       </textarea>
>     </div>
>

IT was my first option. But I had a problem of synchronization with
the server. After the first exachange of messages each time the
handler is called, there's also a duplicate message sent to the
server. I think this is a problem with the ack sequence and the
outgoing message queue, but I hadn't the time to figure out. So I
tried to use the Mochikit event handler, but I had to pass it a
reference to a widget method in order to send data back to the server.
And there came the problems with IE

>
> A difference here wouldn't surprise me.  Iteration in JavaScript is extremely
> inconsistent, even within a single runtime.  I don't know of the /specific/
> problem which causes the behavior you're describing above, and it may be
> fixable, but it'd probably be better just to not rely on iteration.

I know, I did it just to check if I had a reference to the right
objetc, since I couldn't find any method of the widget. With iteration
I can see that they are there, somewere, but I cannot use them :(

-- 
Fabio Forno, PhD
Istituto Superiore Mario Boella
Jabber ID: xmpp:ff at kamin.polito.it
** Try Jabber http://www.jabber.org



More information about the Twisted-web mailing list