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

 }
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to