Posts User::latestPosts(int count) const { return posts.find().where("state = ?").bind(Post::Published) .orderBy("date desc") .limit(count); }
We packaged new versions of our libraries.
Read the detailed release notes
The highlights of this release are:
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.
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.
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.
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).
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") .limit(count); }
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.