By setting
    FormServlet.__init__(self, None, [formDef])
I am pretty shure that you are giving the form no place to render
itself.

You want the form to render as the variable that you define as
$content in your template.

So you can try
  def __init__(self):
        FormServlet.__init__(self, 'getContent', formDefs)

 def writeForm(self):
    rf = self.renderableForm()

So now FormServlet will override getContent and place the results
of writeForm into that method call

Let me know if that works.

Thanks,
-Aaron

----- Original Message -----
From: "Ian Sparks" <[EMAIL PROTECTED]>
To: "Webware-Discuss (E-mail)"
<[EMAIL PROTECTED]>
Sent: Wednesday, April 03, 2002 2:43 PM
Subject: [Webware-discuss] FunFormKit : 2nd Attempt.


> I asked before but didn't get anywhere, probably because the
question was
> too stupid. Let me try again :
>
> I have a Cheetah template like :
>
> "<html><body>$content</body></html>"
>
> my (simplified) writeHTML looks like :
>
> class myPage(Page):
> def writeHTML(self):
>             template =
Template("<html><body>$content</body></html>")
> template.content = self.getContent()
> self.write(template)
> def getContent(self):
> return "override me"
>
> and I override getContent() in sub-classes to return the
content.
>
> I want to plug FunFormKit into this :
>
>     def __init__(self):
>         FormServlet.__init__(self, None, [formDef])
>         myPage.__init__(self)
>
>     def getContent(self):
>       return
self.renderableForm().htFormTable(bgcolor="#ddddff")
>
> But this isn't it. I don't want FormServlet to override any
method to
> writeln() itself out (hence None), I want to defer this to
getContent() to
> pull out the funformKit generated HTML.
>
> The best I can get out of getContent is a TraceBack :
>
>   File "FunFormKit\Form.py", line 110, in renderableForm
>     if self._erroneousRequest:
> AttributeError: myPage instance has no attribute
'_erroneousRequest'
>
> Maybe my approach is all wrong. I'd appreciate any clues.
>
> - Ian Sparks.
>
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>


_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to