Hello!

There are errors in your XML ('title=This is a item title' instead of
'title="This is a item title"', 'class=subitem' instead of
'class="subitem"', etc). In case of errors Wt renders XML
htmlencoded.

On Mon, Apr 15, 2013 at 11:24 AM, Fhulu Lidzhade <[email protected]> wrote:
> Hi there,
>
> I'm trying use WTemplate to create custom HTML widget. WTemplate methods
> work as expected by I cant get it to render as HTML. The page get rendered
> as plain text. Here is the code extract:
>
>   WTemplate *item = new WTemplate(root());
>   item->setTemplateText("<div class=item>${subitem}</div>", XHTMLText);
>
>   WTemplate *subitem = new WTemplate();
>   subitem->setTemplateText("<div class=subitem><a
> title=${title}>${text}</div", XHTMLText);
>   item->bindWidget("subitem", subitem);
>   subitem->bindString("title", "This is a item title", PlainText);
>   subitem->bindString("text", "Item name", PlainText);
>
> An the output is rendered on the browser as:
>
> <div class=item>
> <div class=subitem><a title=This is a item title>Item name</div
> </div>
>
> Instead of just:
>
> Item name
>
> I need the browser to process the <div>'s and apply whatever CSS is defined
> for classes item and subitem instead of displaying the HTML code verbatim.
>
> Regards,
> Fhulu
>
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to