Hey Joseph,

2011/3/17 Joseph VanAndel <[email protected]>:
> I'm using Wt 3.1.8 with Firefox 3.6.15 on Mac OS 10.6.6, and am encountering 
> Wt internal errors.
> My application requires the user to login, and then creates various windows, 
> including
> a log window that I want to auto-scroll as I append messages.  Koen Deforche 
> advised me to do the following:
> =====================================================
>  /*
>  * Little javascript trick to make sure we scroll along with new content
>  */
>  WApplication::instance()->doJavaScript(messages_->jsRef() + ".scrollTop += "
>                    + messages_->jsRef() + ".scrollHeight;");
> =====================================================
>
>
> The problem appears to be that if I destroy this window, and create another 
> one when the user logs in again, the javascript added with 'doJavaScript()' 
> is trying to reference a non-existent window.
>
> Having called the doJavaScript() method, is there any way to disable the 
> javascript that was attached to the event with doJavaScript()?

No. In that case you should make sure the JavaScript does not fail on
a non-existing DOM node:

"if (" + messages_->jsRef() + ") { ... }"

Regards,
koen

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to