I'm trying to use WTemplate so that I can use CSS rather than tables for
layout. The example below  is a simple attempt to use WTemplate based on
sample code in the WTemplate docs, but the resulting web page only shows
the template name. Are there examples of WTemplate I can refer to? Am I
missing a step to make the bound widgets visible? I've searched the Wt
examples, and searched the internet for "Wt" "WTemplate" and didn't really
find anything other than recommendations to use CSS rather than layout
tools.

/*constructor*/ TestApp(const Wt::WEnvironment& env):Wt::WApplication(env)
{

        root()->addWidget( new WText( "one"));

        WTemplate * wtmplate = new WTemplate("Template");
        wtmplate->bindWidget( "Two:", new WText( "two"));
        wtmplate->bindWidget( "Three:", new WText( "three"));

        root()->addWidget( wtmplate );
        // html has: <div id="ommuiys">Template</div> but no bound widgets.

        root()->addWidget( new WText( "four"));

        // Browser shows:
        //   one
        //   Template
        //   four

 }
------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to