Hi Koen 2009/6/23 Koen Deforche <[email protected]>: > You are using setFocus() ? Can you find a pattern in the randomness of > its confusion ?
I found this post - http://forums.htmlhelp.com/index.php?showtopic=5399 Basically (if you believe the information) it seems you have to use a setTimeout() - which seems too much of a hack even for me! So what I did is use a select() after the focus() and it works fine. I do this for both IE and FF - I've not decided if I should only use this logic for IE only. The post's essential point about a separate thread that IE used for Javascript would explain the random failures - again I have not validated if this is in fact true however! And I don't know why select() should help ... Looking at this lead me to a possible bug in Witty: If you use a JSlot and use exec() on it, then the created javascript call is something like xyz(this, e). Of course the "e" causes a javascript error because clearly it has not been set/defined - no event. Maybe the generated java should be xzy(this, null) - err... is null valid javascript? In the end I used WApplication::doJavaScript() which worked fine - but, of course, it sends all the javascript to the browser each time (I guess) - while JSlot seems to be sent once even if you execute it several times (perhaps?). (Apologies if I have got this all wrong) One Last Question :-) Is there a way of defining "global" functions that I can call from my JSlots (or doJavaScript) - of course I can reverse engineer the way Wt calls JSlots - but it would be good to have thoughts on the "official" best practice. Cheers Adrian ------------------------------------------------------------------------------ _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
