Wt
3.3.4
|
Wt Ext library with JavaScript-only widgets (deprecated). More...
Wt Ext library with JavaScript-only widgets (deprecated).
An add-on library to Wt (wtext) provides additional widgets that are all contained within the Wt::Ext namespace. These widgets are implemented using an open-source third-party JavaScript library, extjs (http://extjs.com/), version 2.0, or 2.1 but not higher (does not support Ext 2.2), e.g. http://extjs.com/deploy/ext-2.0.2.zip.
Unlike plain Wt widgets, these widgets require the availability of JavaScript (and a sufficiently recent browser). They do, however, have a polished default look (certainly compared to unstyled plain Wt widgets), and add several new capabilities to Wt:
A Container widget which supports layout using layout managers, and a Panel, which inherits Container, which adds standard GUI functionality to a container, such as tool bars, and support for collapsing and resizing
Form fields that support client-side validation (CheckBox, ComboBox, DateField, LineEdit, NumberField, RadioButton). This has been integrated together with the server side validation in the standard WValidator classes (WDateValidator, WDoubleValidator, WIntValidator, WLengthValidator, WRegExpValidator). In this way, a single validator object specifies at the same time the client- and server-side validation. In this way, the user is given instant feed-back using client-side validation, but the data is also validated (again) as it arrives on the server, since nothing prevents the client JavaScript code from be hacked or circumvented.
TextEdit: a rich text editor, which may be used to edit HTML.
TableView displays data from a WAbstractItemModel. The widget provides sorting, column resizing. In addition, form fiels may be used for inline editing of data, which is propagated back to the model.
Good-looking and flexible Menu and ToolBar classes.
A polished Dialog, MessageBox and ProgressDialog.
Standalone Splitter widget, or integrated in BorderLayout
The functionality of some of these widgets overlaps with existing Wt widgets. Whenever possible, the same API was adopted.
The following table shows corresponding widgets and comments on the resemblance of the APIs.
Wt widget | Wt Ext widget | Comment |
WCalendar | Calendar | The Wt version is more versatile (for example allows multiple selection, and allows more programmatic control. |
WCheckBox | CheckBox | Identical API. |
WComboBox | ComboBox | The Ext version adds a number of features that are similar to those provided by Wt's SuggestionPopup, and allows keeping the entire data set at the server. |
WDialog | Dialog | Almost identical API. The Ext version manages standard buttons. |
WLineEdit | LineEdit | Identical API. |
WMessageBox | MessageBox | Almost identical API. The Wt version is more flexible with respect to buttons, while the Ext version supports prompting for input. |
WRadioButton | RadioButton | Identical API. |
WTextEdit | TextEdit | API differences. The Wt version has more options and is XHTML-compliant. |
You can freely mix Wt widgets and Ext widgets in your application: Wt widgets containers may contain Ext widgets, and vice-versa. From a programmer perspective, there are no differences for using Wt versus Ext widgets.
To use Ext widgets, you need to download the Ext JavaScript library (ext-2.x), and deploy the following files to your web server:
The default value for extBaseURL is "ext/". This value may be overridden with a URL that points to a folder where these files are located, by configuring the extBaseURL property in your Wt configuration file.