Hi everyone The situation is: 1. A pagetemplate, say listInstances, lists hyperlinked instances. A hyperlink has the form http://foo/instances/1. 2. Clicking on said link takes one to ZPT editInstance. 3. ZPT editInstance has a submit button, name btnOK:method. In method btnOK I eventually return ZPT listInstances. However, listInstances does not display the new instance I have added. My code is currently: A) return self.index_html() This does work: B) return self.REQUEST.RESPONSE.redirect(self.index_html().absolute_url()) The problem with B is that I cannot pass parameters to the ZPT (I need to do this, but this is beyond the scope of the question). To summarize: I would like to use A and have ZPT listInstances display the newly added instance. BTW I use ZPatterns. Thanks Hedley ____________________________________________ ISE Technologies (Pty) Ltd Innovation Centre, Technopark, Stellenbosch, 7650, South Africa Tel: +27 (0) 21 880 2456 Fax: +27 (0) 21 880 2457 Web: www.ise.co.za ____________________________________________ "The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). This information may be subjected to attorney and client or other privilege. It must not be disclosed to any person without ISE Technologies permission." "Please note that the recipient must scan this e-mail and any attached files for viruses and the like. ISE Technologies accepts no liability of whatever nature for any loss, liability, damage or expense resulting directly or indirectly from the access of any files that are attached to this message."
Hedley Roos wrote:
To summarize: I would like to use A and have ZPT listInstances display the newly added instance.
A should work...
BTW I use ZPatterns.
...so this may be causing something funky to happen :-S cheers, Chris
Jean from Upfront also thinks so... -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Withers Sent: 31 October 2002 03:29 To: Hedley Roos Cc: zope@zope.org Subject: Re: [Zope] Return ZPT with parameters Hedley Roos wrote:
To summarize: I would like to use A and have ZPT listInstances display the newly added instance.
A should work...
BTW I use ZPatterns.
...so this may be causing something funky to happen :-S cheers, Chris _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hedley Roos writes:
.... A) return self.index_html() This does work: B) return self.REQUEST.RESPONSE.redirect(self.index_html().absolute_url()) The main problem with "B" is that "self.index_html()" almost surely returns a string and a string does not have a method "absolute_url".
Try: "self.index_html.absolute_url()" instead.
The problem with B is that I cannot pass parameters to the ZPT (I need to do this, but this is beyond the scope of the question). You can.
zpt(a standard parameter list) You find your passed in parameters in the standard TALES variable "options". This is a dictionay. Positional parameters are available via the tuple "args" and keyword parameters are available via their key.
To summarize: I would like to use A and have ZPT listInstances display the newly added instance. This has nothing to do with passing parameters...
When a subsequent "listInstances" does not show newly created instances, this may be a cache problem. Force your browser to reload the page. Do you now see the new instance -- then it is a cache problem. Search the mailing list archives for "cache control". There is also a HowTo on Zope.org. Dieter
participants (3)
-
Chris Withers -
Dieter Maurer -
Hedley Roos