Wt 3.1.3, JWt 3.1.3

  • Posted by koen
  • Friday, May 21, 2010 @ 08:47

We packaged new versions of our libraries.

The highlights of this release are:

WTableView reimplemented

The WTreeView View widget renders tree-tables, and therefore also trees and tables as degenerate cases. To efficiently support models with many rows of data, it implements vertical virtual scrolling. Because of the added complexity to support tree tables, its performance degrades when rendering a model with many columns. To have an efficient View class for rendering tables, we have now implemented WTableView to match the functionality of WTreeView (in fact, they share a lot of code through their common base class WAbstractItemView). The table view can efficiently handle large models: its performance is not affected by row or column count since it provides virtual scrolling both horizontally and vertically.

Editing support in item delegates

Item views delegate the rendering of items to an item delegate. By implementing a custom delegate for the view, you could already provide editing support for these view classes. This does however not interact properly with virtual scrolling, since the view is not aware of which items are being edited and does not deal with the editing state when scrolling away and back.

Therefore, we now have added methods in the view classes that indicate how they participate in item editing and item delegates may implement explicit support for saving and restoring their editing state.

Server-side filtering for WSuggestionPopup

So far, WSuggestionPopup provides all suggestion filtering client-side, but this does not work very well when the underlying model is large or expensive to retrieve or compute, since all its values need to be fetched and sent to the client.

We have now added server-side filtering support, which you can enable using setFilterLength(), and there is now also support for scrolling through the suggestions.

Improved plain-HTML fall-back

The library provides two strategies for dealing with plain HTML sessions. The default approach is to detect browser capabilities in a first request and then load the application either using AJAX or redirect to a plain HTML version. The alternative approach, introduced about a year ago, is progressive enhancement.

Using the progressive bootstrap mode, the application is first created assuming only a plain HTML session and progressive to an AJAX application when possible. We have improved the internal handling of this progression, and have it now enabled for more online examples, including the widget gallery. The progressive mode provides the best combination of initial response time since the page is entirely rendered as HTML and transmitted in the first request, and interactivity since the page is upgraded in the background to use AJAX for all further communication. It also avoids rendering annoyances associated with the dynamic loading of stylesheets needed by the default bootstrap method, which was visible especially with Internet Explorer.

At the same time we make sure that even complex widgets such as WTreeView and WTableView work in a plain HTML session (using a page navigation bar).

Improvements in Wt::Dbo

Our young C++ ORM library received a fair amount of attention.

We have now implemented a connection pool, which allows sessions to share connections to your database. A session will use a connection from this pool only while processing a transaction.

We have also refined the query support. Previously, a query was a throw-away object: it could be run only once. Now, a query can now be kept around, and can be changed. You can also build a query piece-by-piece, and intermix this with binding parameters. A collection used in a hasMany() relation) can also be converted to a query using a find() method, which can subsequently be changed. As an example of how these improvements can be useful, consider the following method in User, which is a Dbo with a Many-to-One relation "posts" (from this blog, source code):

Posts User::latestPosts(int count) const
  return posts.find().where("state = ?").bind(Post::Published)
    .orderBy("date desc")

We have also added support for database calls which do not return a result.

Finally, we have added a Wt item model which allows viewing (and in the future, editing!) of query results. You can use this model in conjunction with for example a WTableView to scroll through the results of a query as illustrated in a previous blog post.

  • Posted by matthewbritton
  • 7 years ago
I have a question about video over the web. I'm interested in providing live updates using data from a framegrabber card. These data are DMA'd into RAM, and I would like to find a way to refresh the image displayed by WT in real time. The WHTML5Video class doesn't seem to have a member function that I could use for this purpose. Is this the case, and if so is there another way?

Thank you
  • Posted by wim
  • 7 years ago
In principle, WHTML5Video supports live video streaming - just add the right sources using addSource(...). You could provide an rtsp url, such as rtsp://foo.bar/myvideo.mp4. Unfortunately, I don't know of any browser supporting rtsp. Live streaming seems to be a hot topic (http://code.google.com/p/chromium/issues/detail?id=25573), but it seems there's not yet a de-facto standard in this area. There's some talk about Apple having a streaming protocol in QuickTime over HTTP, but I haven't looked into that.

In the meantime, the another solution I see is to make a normal mp4/ogv/... file on the fly as a WResource, and transfer it over plain http. For that to work, WHTML5Video should ideally accept a WResource in addition to a URL as first parameter to addSource. If you want to go in this direction, I'll be happy to provide it for you.
  • Posted by dmitigr
  • 7 years ago

Contact us for more information
or a personalised quotation