Hi,
Aaron Held hat gesagt: // Aaron Held wrote:
> The action function OVERRIDES self.writeHTML(), so your entire
> page/layout is not called.
>
> the only output of the action in your case will be
> funct
>
> You may need to set some variable and then call
> self.writeHTML()
>
> def func1(self, trans):
> self.msg='funct was called'
> self.writeHTML()
Actually I have found, that this results in two times the head
generated:
<html>
<head>
<title>TheTitle</title>
</head>
<html>
<head>
<title>TheTitle</title>
</head>
TheBody
</html>
</html>
That is why I always use self.writeBody() inside actions now. Or is it
a bug? One can test with this code and "View Source" after
submitting:
# ---- action test: Main.py
from WebKit.Page import Page
class Main(Page):
def __init__(self):
Page.__init__(self)
self.msg='Choose:'
def actions(self):
return Page.actions(self) + ['WriteBD', 'WriteHT']
def WriteBD(self):
self.msg="BD called"
self.writeBody()
def WriteHT(self):
self.msg="HT called"
self.writeHTML()
def writeContent(self):
self.writeln(self.msg)
self.writeln("""
<form method="post">
<input type="submit" name="_action_" value="WriteBD">
</form>
<form method="post">
<input type="submit" name="_action_" value="WriteHT">
</form>
""")
# ---- action test
ciao
--
Frank Barknecht _ ______footils.org__
-------------------------------------------------------
This sf.net email is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss