HI, how do i call zpt in dtml? is there any doc on web that talks abt this.i have browsed a lot, but couldn't locate one plz help me thanks Prasad ________________________________________________________________________ Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
nagendra prasad wrote at 2003-6-18 15:06 +0100:
how do i call zpt in dtml?
Options: <dtml-var myZPT> <dtml-var expr="myZPT(a,b,c)"> The first form calls "myZPT" without parameters, the second with "a,b,c". In "myZPT" you can access arguments via the "options" variable (a dictionary). "args" is the tuple of positional arguments, all other keys specify keyword arguments. Read more in the Zope Book (2.6 edition). Dieter
Hi, thanks for the response. this is what i have done earlier. this is my macros in zpt (name is myZPtemplate).here this form action points to dtml script. ----------------------------------------------------------------- <tr tal:define="startdate request/startdate|nothing"> <th align="left"> <font size=5><font face="verdana"><b> Start Date: </b></font></font> </th> <td><input type="text" name="startdate" tal:replace="structure python:form.startdate.render(startdate)" /> </td> </tr> ----------------------------------------------------------------- this is my dtml script(talks to openflow) that tries to call zpt ---------------------------------------------------------- <dtml-var standard_html_header> <h2><dtml-var document_title></h2> <p> <dtml-let instance="workflow.addInstance('request', AUTHENTICATED_USER.getUserName(), 'no comment', 'Request for Grant by ' + AUTHENTICATED_USER.getUserName(), activation=0)" instobj="_.getattr(workflow,instance)"> **<dtml-call "instobj.manage_addProperty('startdate', startdate, 'string')">** <dtml-call "workflow.startInstance(instance)"> </dtml-let> </p> <p> <a hre f="index_html">To frontpage</a> </p> <dtml-var standard_html_footer> ------------------------------------------------------------------------ Now the line that is marked with * is replaced by <dtml-var expr="myZPtemplate(startdate)"> Now when i run the zpt file & click submit(reaches the dtml file correctly) but still Error Type NameError Error Value name 'startdate' is not defined it always gives an error that occured earlier i have read this doc on http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.stx but doesn;t talk anything abt these plz tell me what to do what is the problem Thanks Prasad
how do i call zpt in dtml?
Options:
<dtml-var myZPT>
<dtml-var expr="myZPT(a,b,c)">
The first form calls "myZPT" without parameters, the second with "a,b,c". In "myZPT" you can access arguments via the "options" variable (a dictionary). "args" is the tuple of positional arguments, all other keys specify keyword arguments.
Read more in the Zope Book (2.6 edition).
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
________________________________________________________________________ Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
nagendra prasad wrote at 2003-6-19 07:04 +0100:
... **<dtml-call "instobj.manage_addProperty('startdate', startdate, 'string')">** ... Now the line that is marked with * is replaced by <dtml-var expr="myZPtemplate(startdate)"> Now when i run the zpt file & click submit(reaches the dtml file correctly) but still Error Type NameError Error Value name 'startdate' is not defined
Look at the traceback (--> "/error_log", when you use Zope 2.6.x). It will tell you where "startdate" is unknown. Note that arguments passed into ZPTs are not available directly but indirectly via "options". Read the Zope Book (2.6 edition) if you need details. Dieter
participants (2)
-
Dieter Maurer -
nagendra prasad