Thang Nguyen schrieb:
> Hi Diez,
> thanks for your email.  You're correct I was using an invalid context 
> object.  After fixing the bug, I was able to display the tree properly.
>  
> I have another question regarding to generating the tree dynamically.  
> Instead of having navTree div defined statically in the template (as in 
> TG tutorial example), I have a python xml string object (mytext) in my 
> controller (root.py).  This string can potentially be 
> created dynamically, but for now i have it predefined.  I pass this 
> string to the template (about.html).  For some reasons, it does not seem 
> to work as the way I expected.   My browser just shows the actual text 
> of "mytext", but not a tree.  Any suggestion for me to try?  Below are 
> code from my root.py and about.html.   Thanks much.
>  
>   @expose('helloworld.templates.about')
>     def about(self, **kw):
>         myTree = TreeView(treeDiv='navTree')
>         pylons.c.tree = myTree
>         mytext =""" <ul>
>                         <li class=\"open\"> product123

And in triple-quotes, you don't need to escape quotes. Also, *don't* use 
pylons-imports, use tg. While this is currently only an alias, that 
might change in the future.

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to