Form action has no effect
I had a Zope product that was working OK about a year ago. Now it's not. It seems the form action is not having any effect when I click on the button in the interface. As far as I can tell, the action is never called. I have tried this with Zope 2.4.3, which I think is the same version I ran before, and a fresh install of 2.6.1. One reason for the install was that I moved the entire application directory to a new drive in between, and I thought this might have caused some problems (I manually edited the paths I found). I also extended the app, but not in a way having any connection with the display of the form or action on it that I can see. I'm under MS Win 2k. When I type method calls directly into the browser (Mozilla) I call into the method or get a traceback if the name isn't recognized. But when I hit the action button on the form, I get no change at all except sometimes the URL gets the function arguments, e.g., http://localhost:8080/DSA/DSASync/DSASync/index_html?ignoreBlanks=ignore+bla... where the part from the ? on is new. (Not all tests have the DSASync/DSASync stutter). The dtml form is, in the relevant part: <form action="doddddCompare" method="POST"> <label>Ignore Empty Fields? <input type="checkbox" name="ignoreBlanks" value="ignore blanks" checked> </label><BR> <label>Keys <input type="text" name="key1" value="DSAID"> <input type="text" name="key2"> </label><BR> <input type="SUBMIT" value="compute differences"> </form> When I hit the form's button, I get no traceback that dodddCompare isn't found, and when I enter the real name (doCompare) I do not end up in the relevant method. I have verified that altering other text effects the form, so I am editing the right file and it is being picked up. The other odd thing is that I'm doing this as the root user created at Zope system creation. I thought such users could only create other users, but I'm able to create my object too. I've tried creating another user, but haven't been able to get past permission problems with it. The object statements that gets the form is index_html in the excerpt from the class def below: security = ClassSecurityInfo() security.declareObjectPublic() # added this to try to make things work # never was sure if this needed security # but I can see the form, so I'm OK, right? index_html = HTMLFile("diff", globals()) # here's the method that I'm trying to invoke security.declareProtected('View', 'doCompare') def doCompare(self, ignoreBlanks = None, key1="DSAID", key2=None, RESPONSE = None): # print statements in here never produce output # debug statements never induce a halt I would really appreciate any help, even advice on how to debug this.
Ross Boylan wrote at 2003-4-21 17:14 -0800:
I had a Zope product that was working OK about a year ago. Now it's not. It seems the form action is not having any effect when I click on the button in the interface. As far as I can tell, the action is never called.
Whether or not the action is activated is not a Zope but a browser issue (provided the form is rendered correctly). You might use a TCP logger (e.g. Shane's "tcpwatch") to find out what goes on between your browser and Zope. Dieter
I added <head> and <body> parts to the page and now it works. I saw something in the developers' guide that one needs a <head> for the action URLs to resolve properly. It's a bit weird, since I tried the action with action="<dtml-var absolute_url>/doCompare" and it didn't help (until adding the <head>). It's also weird because it was working before. But at least it's working now On Tue, Apr 22, 2003 at 09:32:16PM +0200, Dieter Maurer wrote:
Ross Boylan wrote at 2003-4-21 17:14 -0800:
I had a Zope product that was working OK about a year ago. Now it's not. It seems the form action is not having any effect when I click on the button in the interface. As far as I can tell, the action is never called.
Whether or not the action is activated is not a Zope but a browser issue (provided the form is rendered correctly).
You might use a TCP logger (e.g. Shane's "tcpwatch") to find out what goes on between your browser and Zope.
Dieter
Probably because of BASE tag insertion magic. ----- Original Message ----- From: "Ross Boylan" <RossBoylan@stanfordalumni.org> To: "Dieter Maurer" <dieter@handshake.de> Cc: "Ross Boylan" <RossBoylan@stanfordalumni.org>; <zope-dev@zope.org> Sent: Tuesday, April 22, 2003 9:08 PM Subject: Re: [Zope-dev] Form action has no effect
I added <head> and <body> parts to the page and now it works. I saw something in the developers' guide that one needs a <head> for the action URLs to resolve properly.
It's a bit weird, since I tried the action with action="<dtml-var absolute_url>/doCompare" and it didn't help (until adding the <head>).
It's also weird because it was working before.
But at least it's working now
On Tue, Apr 22, 2003 at 09:32:16PM +0200, Dieter Maurer wrote:
Ross Boylan wrote at 2003-4-21 17:14 -0800:
I had a Zope product that was working OK about a year ago. Now it's not. It seems the form action is not having any effect when I click on the button in the interface. As far as I can tell, the action is never called.
Whether or not the action is activated is not a Zope but a browser issue (provided the form is rendered correctly).
You might use a TCP logger (e.g. Shane's "tcpwatch") to find out what goes on between your browser and Zope.
Dieter
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
participants (3)
-
Chris McDonough -
Dieter Maurer -
Ross Boylan