On 2 Jul 2007, at 01:32, venkatbo wrote:

>
> Hi folks,
>
> When I attempt to use controller logic like so:
>
>    ...
>   @turbogears.expose(format="xhtml-strict")
>   def default(self, *args, **kwargs):
>      ...
>      if first_req1:
>         # send kid-template and data to be filled in
>         ...
>         return (tg_template="xyz", autorefresh_url=url_after_1st_req,
> data=data...)
>      else:
>         # all subsequent accesses (via url_after_1st_req)
>         # send just the data...
>         return (data=data)
>
> I get a runtime kid-template-engine error that says:
> "All templates must be in a package"
>
> I was under the impression for all the ajaxian (2nd request onwards)
> request, there is no need to send a template, since its known already.
>
> What is the correct doSimpleXMLHttpRequest usage syntax, so
> that every ajaxian request for content works ok - to change the
> contents of a div via .innerHTML updates.
>

Do you get that error on the first or second request?  If the first,  
you need to put the template "kyz.kid" in the templates directory (or  
another directory that also contains __init__.py) and specify it as  
".templates.kyz".  Kid templates work by importing them as Python  
modules.

For the second return, no template is specified so I can't see how  
that will work?

Also, do your returns work?  Shouldn't they be returning dicts ? ie:
return dict(tg_template="xyz", autorefresh_url=url_after_1st_req,  
data=data)
return dict(data=data)

Cheers,
Chris Miles


--~--~---------~--~----~------------~-------~--~----~
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