Actions
Feature #83
closedWTemplate
Start date:
08/28/2009
Due date:
% Done:
0%
Estimated time:
Description
It would be great to support XHTML not only as "leaf" content, in WText, but also as an intermediate container in which you may again instantiate other widgets. This would be especially useful for using XHTML for (top-level) layout purposes.
WTemplate
takes a WString
containing a template (which can thus be easily pushed out to an XML resource file). The template is plain XHTML, with support for a special (non-XHTML) tag:
<widget wid="myButton" class="btn" ... />
(or wt:widget
should that be easy to make XML parsers accept).
WTemplate
should define two member methods:
-
virtual WWidget *createWidget(const std::string &wid)
: looks up the widget to substitute each widget tag found in the template. The default implementation will consult amap<std::string, WWidget *>
of widgets. Attributes defined for the widget are set to theDomElement
.
<!-- -->
-
setWidget(const std::string& wid, WWidget *widget)
: adds a widget to the map.
Updated by Koen Deforche over 14 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
Implemented in blog branch
Updated by Koen Deforche over 14 years ago
- Status changed from Resolved to Closed
Actions