Hi,
I'm just getting started with pylons and I have a question. Here's
the basic setup.
1. My controller index function sets some class variables. (eg.
self.myvar )
2. It then renders a template.
3. The template html loads some javascript in the standard html way
( eg. <script type="text/javascript" src="my javascript.js"></
script> )
4. The page is loaded and all is happy.
5. On a certain action, the javascript get's called and I'd like to
point back to my controller object.. calling a different function.
But it seems that it creates a new instance of the class because the
'self.myvar' no longer exists.
.
Any help greatly appreciated.
Here's a bit different way of explaining it
class WbController(BaseController):
def index(self):
# get some info from the urlr
self.myvar = "some info here"
# pass that info to the template.
return render('/foo.mako')
def foo(self):
# foo get's called by the javascript that is loaded in the
template..
# but self.myvar doesn't exist !!!??
------------------ javascript snip---------
var url = "wb/foo";
xmlhttpPut.onreadystatechange=empty;
xmlhttpPut.open("GET",url,true);
xmlhttpPut.send(null);
many thanks,
david
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---