Re: [Zope] Passing parameters to methods - how to?
"César A. K. Grossmann" wrote: Maik Roeder wrote: Clicking in the "submit" button, it gives me an error, telling that 'username' is not defined. So I included an hidden field with name="username" and value="dtml-var username", but I'm thinking this is not the better way to do that... That is the real question: how to substitute the 'a href="ManageUserProperties?username=someuser"someuser/a' using hidden fields? M I'm thinking that maintaining some "session attributes" in a cookie is another idea, and sustitute the direct call to the method to a call to a JavaScript, but I don't want to use the most complicated method... There are only two ways of doing this: 1) hidden form inputs 2) cookies 3) session variables (kind of like number 2) Using the former solution, you can make your link be the submit button for the form, either by using Javascript (yuk: a href="javascript:document.forms['myform'].submit()"someuser/a) or by making it a graphical button rather than a text link (input type=button, img="button.gif" as far as I remember, but I might be wrong). Why use javascript to access cookies? You can set and get them purely using zope. http://www.zope.org/Members/BwanaZulia/cookies. Also, why not install a session product (HappySession, FSSession, SQLSession...), it'll probably make your life easier in the long run... seb ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Passing parameters to methods - how to?
Maik Roeder wrote: Clicking in the "submit" button, it gives me an error, telling that 'username' is not defined. So I included an hidden field with name="username" and value="dtml-var username", but I'm thinking this is not the better way to do that... To my knowledge, it's the only way to do it, and if it works, why bother ? And from the first link, there are a way to include such a hidden field when calling a link? That is the real question: how to substitute the 'a href="ManageUserProperties?username=someuser"someuser/a' using hidden fields? ManageUserProperties is an DTML method, and are differents calls, with differents usernames in the same page (if I put a hidden field it's value will be the same to all the calls to the DTML Method in question). I'm thinking that maintaining some "session attributes" in a cookie is another idea, and sustitute the direct call to the method to a call to a JavaScript, but I don't want to use the most complicated method... []s -- +-+-+ | César A. K. Grossmann | Capacitação Solidária | | [EMAIL PROTECTED]| http://www.uol.com.br/umminuto/ | | http://members.xoom.com/ckant/ | Clique e doe - é de graça | +-+-+ http://www.halcyon.com/sciclub/cgi-pvt/instr/instr.html If you know the answer to a question, don't ask. -- Petersen Nesbit ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Passing parameters to methods - how to?
Hi! I'm making my own user managements methods, and I'm stucked with a (simple) problem: How do I call another DHTML method, passing parameters to it, in HTML? I'm using a DTML Method that gives me a list of usernames. I want to click on the username and get the properties for that username. I wrote another DTML Method to do that, but I don't know how to pass the username to this second DTML Method. The username list page have, for every user, a line like that (suppose two usernames, fred and jorge): a href="ManageUserProperties"fred/abr a href="ManageUserProperties"jorge/abr How do I pass the username to the ManageUserProperties DTML Method? I have tried to use something like: a href="ManageUserProperties?username=fred"fred/abr a href="ManageUserProperties?username=jorge"jorge/abr It works, but the ManageUserProperties DTML Method have another form in it, that calls itself, using the POST method: form action="ManageUserProperties" method="POST" Clicking in the "submit" button, it gives me an error, telling that 'username' is not defined. So I included an hidden field with name="username" and value="dtml-var username", but I'm thinking this is not the better way to do that... Can someone helps me? TIA -- César A. K. Grossmann [EMAIL PROTECTED] http://members.xoom.com/ckant/ http://www.halcyon.com/sciclub/cgi-pvt/instr/instr.html ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Passing parameters to methods - how to?
Hi Cesar ! Clicking in the "submit" button, it gives me an error, telling that 'username' is not defined. So I included an hidden field with name="username" and value="dtml-var username", but I'm thinking this is not the better way to do that... Can someone helps me? To my knowledge, it's the only way to do it, and if it works, why bother ? Regards, Maik -- Uzopia - Digging la vida Zopa - http://uzopia.editthispage.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )