Project

General

Profile

Actions

Feature #83

closed

WTemplate

Added by Koen Deforche over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
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 a map<std::string, WWidget *> of widgets. Attributes defined for the widget are set to the DomElement.

<!-- -->

  • setWidget(const std::string& wid, WWidget *widget): adds a widget to the map.
Actions #1

Updated by Koen Deforche over 14 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche

Implemented in blog branch

Actions #2

Updated by Koen Deforche over 14 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF