Hey Stefan, 2012/1/31 Stefan Ruppert <s...@myarm.com>: > Hi all, > > I want to use a loading indicator to measure the loading time of a > WebRequest!?
The actual place to measure the loading time is best done in an overloaded WApplication::notify(), measuring the time around the base call to notify(). But then you are too late to show this number to the user, since the rendering phase will already be finished. It's a bit a circular thing: trying to measure how long it takes to render and render the result of this measurement. > Our web application is a frontend to a database containing a huge amount > of data. Therefore we want a generic way to measure and present the > loading time to the user. The idea I had is to implement a special > loading indicator and reimplement setHidden() method taking a start > timestamp when the widget is shown and a stop timestamp when the widget > is hidden again... But this does not work. As you imagine, indeed, the loading indicator is a client-side affair since it will show when the server takes too long to respond. However, Wt does this by optimizing setHidden() using "stateless slot learning" of show() and hide(). You can thus reimplement setHidden() in a special loading indicator and use doJavaScript() -- these calls will be also be "pre-learned" as client-side JavaScript. Thus something like: void MyLoadingIndicator::setHidden(bool hidden) { if (!hidden) { doJavaScript("..."); } else { doJavaScript("..."); } WLoadingIndicator::setHidden(hidden); } The JavaScript could do whatever you want, including modifying the loading indicator text or anything else, but it will be purely javascript. Regards, koen ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest