[Zope] Re: Re: [Zope] detail record editing
> On Mon, 5 Jun 2000, Robert Del Huerto wrote: > > > database. I'm stuck after that. The form only has one 'action' so how > > would I get it to handle the right function depending on the button that > > was pushed? I'm no HTML expert but I've looked around quite a bit for > > It can be done with some badly documented magic (see > http://www.zope.org/Members/Zen/howto/FormVariableTypes when zope.org > is working again :-P) > > Example: > > > > > > Wow, live can be so easy ;-) But I wonder if I can pass additional parameters to the methods. No, does not fit my needs as the parameter to pass has always the same name but different values for each method. > > In this example, the action is never called. If the user clicks on > the delete button, the method 'delete' (generally in the same folder as this This is not necessary as I have found out. You can give full qualified paths to the methods eg. . > form) is called instead of the action. Similarly, click on Modify and the > method called 'modify' is called instead of the action. > > I'll try to remember to put this up as a tip on zope.org when its possible... > > -- > Stuart Bishop Work: [EMAIL PROTECTED] > Senior Systems Alchemist Play: [EMAIL PROTECTED] > Computer Science, RMIT University TIA, Andreas ** This email message has been swept by MIMEsweeper for the presence of computer viruses. Francotyp-Postalia AG & Co. ___ 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] detail record editing
do your adding thing do your modifying thing do your deleting thing do your 'Whoa! something ain't right here' thing - Original Message - From: ethan mindlace fremen <[EMAIL PROTECTED]> To: Robert Del Huerto <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, June 06, 2000 2:42 PM Subject: Re: [Zope] detail record editing Robert Del Huerto wrote: > +---+---+-++ > | |Doe|Jane |$100.00 | > +---+---+-++ > | X |Doe|John |$250.00 | > +---+---+-++ > | |Haggis |Meister |$100.00 | > +---+---+-++ > | |Zoper |Doper|$723.00 | > +---+---+-++ > | +--+ +--+ +--+ | > | | ADD| | MODIFY | | DELETE | | > | +--+ +--+ +--+ | > +--+ You can have as many action="submit"'s as you want. Untested: The form only submits the value of "successfull" form items, so, on your form's action method: do your adding thing do your modifying thing do your deleting thing ~ethan @ digicool ___ 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 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] detail record editing
Robert Del Huerto wrote: > +---+---+-++ > | |Doe|Jane |$100.00 | > +---+---+-++ > | X |Doe|John |$250.00 | > +---+---+-++ > | |Haggis |Meister |$100.00 | > +---+---+-++ > | |Zoper |Doper|$723.00 | > +---+---+-++ > | +--+ +--+ +--+ | > | | ADD| | MODIFY | | DELETE | | > | +--+ +--+ +--+ | > +--+ You can have as many action="submit"'s as you want. Untested: The form only submits the value of "successfull" form items, so, on your form's action method: do your adding thing do your modifying thing do your deleting thing ~ethan @ digicool ___ 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] The ZPublisher :method type (was RE: [Zope] detail record editing))
> My solution for this kind of problem is to have a DTML method > that delegates > to the > appropriate DTML methods. Therefore each button gets a value > and a name, eg. > > Actually, you can use the Bobo ":method" type. It's documented...somewhere :). You can do: and the Publisher will add the selected method to the end of the path. Make your form action be &dtml-URL1; or "./" There's a default_method type too, I think you *might* see it in action on the "Rename" form in the Zope management screens. ___ 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] detail record editing
On Mon, 5 Jun 2000, Robert Del Huerto wrote: > database. I'm stuck after that. The form only has one 'action' so how > would I get it to handle the right function depending on the button that > was pushed? I'm no HTML expert but I've looked around quite a bit for It can be done with some badly documented magic (see http://www.zope.org/Members/Zen/howto/FormVariableTypes when zope.org is working again :-P) Example: In this example, the action is never called. If the user clicks on the delete button, the method 'delete' (generally in the same folder as this form) is called instead of the action. Similarly, click on Modify and the method called 'modify' is called instead of the action. I'll try to remember to put this up as a tip on zope.org when its possible... -- Stuart Bishop Work: [EMAIL PROTECTED] Senior Systems Alchemist Play: [EMAIL PROTECTED] Computer Science, RMIT University ___ 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] detail record editing
> I'm just beginning my journey into Zopeland so please forgive my > ignorance. I'd like to be able to give users a chance to edit records > found in a table by selecting the desired record's checkbox and then > clicking 'Modify'. This is similar to the Zope management screen. I > just don't know how to approach it. > > I can get Zope to generate a table and form like this from an SQL > database. I'm stuck after that. The form only has one 'action' so how > would I get it to handle the right function depending on the button that > was pushed? I'm no HTML expert but I've looked around quite a bit for > an answer and I can't seem to find any info on handling multiple submit > buttons. Can Zope make this any easier? (using ZClasses, maybe?) I've > also tried searching through the mail archives but I haven't found > anything yet. (There are a lot of messages to go through them one at a > time.) My solution for this kind of problem is to have a DTML method that delegates to the appropriate DTML methods. Therefore each button gets a value and a name, eg. The DTML method delegating the calls looks like this: The except part catches the cases where an error occurs such like action is not determined. Beware of the fact that you might want to pass further parameters in order to determine the selected item or so. HTH Andreas Francotyp-Postalia AG & Co. Dipl. Inform. Andreas Wacknitz Abteilung TEE Triftweg 21-26 D-16547 Birkenwerder ** This email message has been swept by MIMEsweeper for the presence of computer viruses. Francotyp-Postalia AG & Co. ___ 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 )