Hi all! I create a ZPT with this result: <form name="Borrador" method="post" action="http://yanged:8280/Papeles/Yanged/Links/Eliminar/"> <div id="Borrable"> <input type="submit" value="Eliminar" name="Borrador" /> </div> <div class="Links" id="Links1"> <div id="Movible"><input type="checkbox" name="Movible:list" value="Links1" /></div> <div id="Titulo" class="Campo"> <a href="http://yanged:8280/Papeles/Yanged/Links/Editar/Links1">Mis Cosas</a> </div> <div id="Direccion" class="Campo"> <a href="http://blogs.sistes.net/Garito/">http://blogs.sistes.net/Garito/</a> </div> </div> </form> The original result has more <div class="Links"> with id="Links2", etc that I delete for your confort (I think this don't modify the problem) My question is why If I push Eliminar button don't submit the form to the correct url (http://yanged:8280/Papeles/Yanged/Links/Eliminar)? Thanks! -- Mis Cosas http://blogs.sistes.net/Garito/
--On 6. Juli 2005 10:29:45 +0200 Garito <garito@sistes.net> wrote:
My question is why If I push Eliminar button don't submit the form to the correct url (http://yanged:8280/Papeles/Yanged/Links/Eliminar)?
What happens instead? Look at your Z2.log to figure out what is requested. -aj
Andreas Jung escribió:
--On 6. Juli 2005 10:29:45 +0200 Garito <garito@sistes.net> wrote:
My question is why If I push Eliminar button don't submit the form to the correct url (http://yanged:8280/Papeles/Yanged/Links/Eliminar)?
What happens instead? Look at your Z2.log to figure out what is requested.
-aj
Hi Aj! this is the Z2.log modification after submit the form *192.168.0.129 - Garito [06/Jul/2005:10:38:03 +0200] "POST /Papeles/Yanged/Links/Eliminar/ HTTP/1.1" 302 383 "http://yanged:8280/Papeles/Yanged/Links/Ver" "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.7.8) Gecko/20050511 Firefox/1.0.4" 192.168.0.129 - Garito [06/Jul/2005:10:38:03 +0200] "GET /Papeles/Yanged/Links/Ver HTTP/1.1" 200 3434 "http://yanged:8280/Papeles/Yanged/Links/Ver" "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.7.8) Gecko/20050511 Firefox/1.0.4" 192.168.0.129 - Garito [06/Jul/2005:10:38:03 +0200] "GET /favicon.ico HTTP/1.1" 404 1266 "" "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"* Thanks! -- Mis Cosas http://blogs.sistes.net/Garito/
Garito wrote:
Andreas Jung escribió:
--On 6. Juli 2005 10:29:45 +0200 Garito <garito@sistes.net> wrote:
My question is why If I push Eliminar button don't submit the form to the correct url (http://yanged:8280/Papeles/Yanged/Links/Eliminar)?
What happens instead? Look at your Z2.log to figure out what is requested.
-aj
Hi Aj! this is the Z2.log modification after submit the form
*192.168.0.129 - Garito [06/Jul/2005:10:38:03 +0200] "POST /Papeles/Yanged/Links/Eliminar/ HTTP/1.1" 302
-> 10.3.3 302 Found The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field. The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s). If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. Note: RFC 1945 and RFC 2068 specify that the client is not allowed to change the method on the redirected request. However, most existing user agent implementations treat 302 as if it were a 303 response, performing a GET on the Location field-value regardless of the original request method. The status codes 303 and 307 have been added for servers that wish to make unambiguously clear which kind of reaction is expected of the client. (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)
383 "http://yanged:8280/Papeles/Yanged/Links/Ver" "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
192.168.0.129 - Garito [06/Jul/2005:10:38:03 +0200] "GET /Papeles/Yanged/Links/Ver HTTP/1.1" 200 3434
Your POST request seems to be transformed into a GET to another url... Now *why* this happens, I can't tell you... -- Bruno Desthuilliers Développeur bruno@modulix.org
A wild guess: Your post works, but returns a redirect to a nother page, which returns nothing. This will look exactly like notyhing happened at the browser side.
Lennart Regebro escribió:
A wild guess: Your post works, but returns a redirect to a nother page, which returns nothing. This will look exactly like notyhing happened at the browser side.
Yes, looking at Z2.log it seems it but If I execute the action url manually it works like I expect Any idea? Thanks! -- Mis Cosas http://blogs.sistes.net/Garito/
Garito wrote:
Lennart Regebro escribió:
A wild guess: Your post works, but returns a redirect to a nother page, which returns nothing. This will look exactly like notyhing happened at the browser side.
Yes, looking at Z2.log it seems it but If I execute the action url manually it works like I expect
Any idea?
Since we're not able to guess what your code is doing (well, I, at least, am not able to...), you could perhaps post it ? One thing that strikes me is the final slash in "POST /Papeles/Yanged/Links/Eliminar/" What is "Eliminar", exactly ? -- Bruno Desthuilliers Développeur bruno@modulix.org
bruno modulix escribió:
Garito wrote:
Lennart Regebro escribió:
A wild guess: Your post works, but returns a redirect to a nother page, which returns nothing. This will look exactly like notyhing happened at the browser side.
Yes, looking at Z2.log it seems it but If I execute the action url manually it works like I expect
Any idea?
Since we're not able to guess what your code is doing (well, I, at least, am not able to...), you could perhaps post it ?
One thing that strikes me is the final slash in "POST /Papeles/Yanged/Links/Eliminar/"
What is "Eliminar", exactly ?
Links/Eliminar is the execution path (using traverse_subpath) But if I execute the action URL directly on the browser it works fine -- Mis Cosas http://blogs.sistes.net/Garito/
Garito wrote:
bruno modulix escribió:
Garito wrote:
Lennart Regebro escribió:
A wild guess: Your post works, but returns a redirect to a nother page, which returns nothing. This will look exactly like notyhing happened at the browser side.
Yes, looking at Z2.log it seems it but If I execute the action url manually it works like I expect
Any idea?
Since we're not able to guess what your code is doing (well, I, at least, am not able to...), you could perhaps post it ?
One thing that strikes me is the final slash in "POST /Papeles/Yanged/Links/Eliminar/"
What is "Eliminar", exactly ?
Links/Eliminar is the execution path
<sarcastic> Oh yes ? Really ? I sure wouldn't have guessed </sarcastic>
(using traverse_subpath)
But if I execute the action URL directly on the browser it works fine
Garito, if you expect anyone here to be of any help, please provide *useful* informations. When I ask ">> What is "Eliminar", exactly ?", I of course mean "what kind of object is it" (ie: a dtml method, a python script, etc...). PS: You may want to read this: http://www.catb.org/~esr/faqs/smart-questions.html -- Bruno Desthuilliers Développeur bruno@modulix.org
bruno modulix escribió:
Garito wrote:
bruno modulix escribió:
Garito wrote:
Lennart Regebro escribió:
A wild guess: Your post works, but returns a redirect to a nother page, which returns nothing. This will look exactly like notyhing happened at the browser side.
Yes, looking at Z2.log it seems it but If I execute the action url manually it works like I expect
Any idea?
Since we're not able to guess what your code is doing (well, I, at least, am not able to...), you could perhaps post it ?
One thing that strikes me is the final slash in "POST /Papeles/Yanged/Links/Eliminar/"
What is "Eliminar", exactly ?
Links/Eliminar is the execution path
<sarcastic> Oh yes ? Really ? I sure wouldn't have guessed </sarcastic>
(using traverse_subpath)
But if I execute the action URL directly on the browser it works fine
Garito, if you expect anyone here to be of any help, please provide *useful* informations. When I ask ">> What is "Eliminar", exactly ?", I of course mean "what kind of object is it" (ie: a dtml method, a python script, etc...).
PS: You may want to read this: http://www.catb.org/~esr/faqs/smart-questions.html
Hi Bruno http://yanged:8280/Papeles/Yanged/Links/Eliminar is an url that if I call it from my browser executes some python scripts that I define in a XML file Then Eliminar is a string not an object nor a method because, as I told you some mails ago, I has it via traverse_subpath The real Object (travesed) is Yanged that is a mixed object with a ZCatalog and a folder (like plone portal_catalog) When I ask for Yanged/Links/Eliminar I ask to the XML file to see what Python Scripts or Page Templates give back to me and the I execute them But, I think its very interesting for me that an action url don't work if I submit the form but works if I call it directly from the browser. Interesant, no? Thanks PD: thanks for the smart-questions page, very interessant! PD2: sorry for the personal mail I send you (2 mails) but if you push reply button only the personal email is used. It's necesary to push reply all one, sorry! -- Mis Cosas http://blogs.sistes.net/Garito/
Garito wrote:
bruno modulix escribió:
(snip)
Hi Bruno http://yanged:8280/Papeles/Yanged/Links/Eliminar is an url that if I call it from my browser executes some python scripts that I define in a XML file
Then Eliminar is a string not an object nor a method because, as I told you some mails ago, I has it via traverse_subpath
mmm...
The real Object (travesed) is Yanged that is a mixed object with a ZCatalog and a folder (like plone portal_catalog)
Ok, that's what I wanted to know...
When I ask for Yanged/Links/Eliminar I ask to the XML file to see what Python Scripts or Page Templates give back to me and the I execute them
But, I think its very interesting for me that an action url don't work if I submit the form but works if I call it directly from the browser.
<thinking-out-loud> 1/ Do you call it exactly the same way ? ie: "http://yanged:8280/Papeles/Yanged/Links/Eliminar/" or "http://yanged:8280/Papeles/Yanged/Links/Eliminar" 2/ When you call it 'directly from the browser', you send a GET request. When you call it from the form, you send a POST request. This may have something to do with your problem... Are you sure you end up calling the same component in both cases ? Is there any component involved that act differently depending on the HTTP method ? </thinking-out-loud> Sorry, nothing more... :( -- Bruno Desthuilliers Développeur bruno@modulix.org
Hi. I am trying to use the make_hidden_input function in ZTUtils to create a hidden input in a ZPT but it does not appear. I am using this: <form name="language_delete_form" action="actions_language_summary" method="post" enctype="multipart/form-data" tal:define="mhi python:modules['ZTUtils'].make_hidden_input; dummy python:mhi(delete_ids=results)"> results is a list of dictionaries I want to pass to the form method Can someone point out what I doing wrong? Many thanks. Regards, David
<form name="language_delete_form" action="actions_language_summary" method="post" enctype="multipart/form-data" tal:define="mhi python:modules['ZTUtils'].make_hidden_input; dummy python:mhi(delete_ids=results)"> <br tal:replace="structure dummy" /> On 7/7/05, David Pratt <fairwinds@eastlink.ca> wrote:
Hi. I am trying to use the make_hidden_input function in ZTUtils to create a hidden input in a ZPT but it does not appear.
I am using this:
<form name="language_delete_form" action="actions_language_summary" method="post" enctype="multipart/form-data" tal:define="mhi python:modules['ZTUtils'].make_hidden_input; dummy python:mhi(delete_ids=results)">
results is a list of dictionaries I want to pass to the form method
Can someone point out what I doing wrong? Many thanks.
Regards, David _______________________________________________ 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 )
-- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
--On 7. Juli 2005 12:00:32 -0300 David Pratt <fairwinds@eastlink.ca> wrote:
Hi. I am trying to use the make_hidden_input function in ZTUtils to create a hidden input in a ZPT but it does not appear.
I am using this:
<form name="language_delete_form" action="actions_language_summary" method="post" enctype="multipart/form-data" tal:define="mhi python:modules['ZTUtils'].make_hidden_input; dummy python:mhi(delete_ids=results)">
This code is odd. First you should something to appear inside the scope of a <form> tag inside a dedicated tag. And you're defining mhi and dummy using tal:define but you don't them anywhere neither using tal:content nor tal:replace. -aj
On 7/7/05, David Pratt <fairwinds@eastlink.ca> wrote:
Hi. I am trying to use the make_hidden_input function in ZTUtils to create a hidden input in a ZPT but it does not appear.
Well, then, whats the problem?! :-) (sorry)
<form name="language_delete_form" action="actions_language_summary" method="post" enctype="multipart/form-data" tal:define="mhi python:modules['ZTUtils'].make_hidden_input; dummy python:mhi(delete_ids=results)">
<tal:block replace="structure python:mhi(delete_ids=results)" /> Seems more reasonable then just assigning it to a dummy variable, Not that I have ever used make_hidden_input, mind you, I make <input type="hidden" /> instead. Seems easier. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
Super, that solved the problem. I had googled and couldn't find an example of mhi. Only the api docs which didn't say very much about using it in a form. I guess it should have occurred to me to use structure if the output is html. Problem was that I hadn't actually seen an example of the output of this function anywhere - so not quite sure if I had to make an input tag myself and the function just filled the attributes or what. Now I know. I had a good laugh at what I had written afterwards, go figure a hidden field that will not appear, hmm... what could be wrong with that - except maybe too much time at a computer :-) Sorry Andreas on the small piece of zpt I provided, there is much more to the form but thought what I provided would illustrate what I was trying to do. Many thanks. Regards, David On Thursday, July 7, 2005, at 12:12 PM, Lennart Regebro wrote:
On 7/7/05, David Pratt <fairwinds@eastlink.ca> wrote:
Hi. I am trying to use the make_hidden_input function in ZTUtils to create a hidden input in a ZPT but it does not appear.
Well, then, whats the problem?! :-) (sorry)
participants (6)
-
Andreas Jung -
bruno modulix -
David Pratt -
Garito -
Lennart Regebro -
Peter Bengtsson