[Zope] Delete multiple posts
Gitte Wange
gitte@mmmanager.org
03 Apr 2001 16:40:02 +0200
Okay now it passes something - that's better that before :-)
But what argument must I thn write in my sql method?
It looks like it passes "DeleteClips:list=<id>" so should I put
DeleteClips:list in as an argument in my sql method ?
Gitte
On 03 Apr 2001 12:59:40 +0200, Tino Wildenhain wrote:
> Hi Gitte,
>
> please read carefully!
>
> The name of your gadget in the form has to be prepended with the
> type zope should coerse its content into.
> So you have to write <input type="checkbox" name="DeleteArray:list" ...
>
> Please please forget all the things with PHP, Perl etc ;)
>
> Regards
> Tino
>
> Gitte Wange wrote:
> >
> > Sorry for me being slow on this but the items I need to delete is in my
> > MySQL database.
> > So I only need the code for iterating through the selected items. Then
> > call the sqlMethod that deletes the items whenever a item is checked.
> >
> > So I had thought of something like:
> > <FORM ACTION="DelItems">
> > <TABLE>
> > <dtml-in ItemQuery>
> > <TR>
> > <TD><dtml-var itemname></TD>
> > <TD><INPUT TYPE="checkbox" NAME="DeleteArray[]" VALUE="<dtml-var
> > id>"></TD>
> > </TR>
> > </TABLE>
> > </FORM>
> >
> > The DelItems method:
> > <dtml-with DeleteArray[]>
> > <dtml-call sqlDelItem>
> > </dtml-with>
> >
> > But how do you make an array in Zope and is it the correct way to
> > iterate through it ?
> >
> > Gitte
> >
> > On 03 Apr 2001 11:07:49 +0200, Jan Lentfer wrote:
> > > Am Dienstag, 3. April 2001 10:21 schrieb Gitte Wange:
> > > > Well I'm sorry to say this, but it seems a bit more complicated than
> > > > what I need. Isn't it possible to make an array out of a select box
> > > > (with only the selected items in the array) and just run through this
> > > > array to delete the items ?
> > > >
> > > > Gitte
> > >
> > > I don't have time to explain it, but maybe this snippets from my code can
> > > help you:
> > >
> > > First part, display the items in a table:
> > > ---------------------------
> > > <FORM action="board_delProcessor" mehtod=post>
> > >
> > > <TABLE border=1 width=75% align=center bgcolor="lightgrey"
> > > bordercolorlight="#999999" bordercolordark="#666666" cellspacing="1"
> > > cellpadding="8">
> > >
> > > <dtml-with entries>
> > >
> > > <dtml-in "objectValues(['Message Board Entry'])">
> > > <dtml-var manage_html>
> > > </dtml-in>
> > > </dtml-with>
> > > </TABLE>
> > > [...]
> > >
> > >
> > >
> > > Second part, manage_html
> > > -------------------
> > > <TR>
> > > <TD align="center" width ="5%"><INPUT type ="checkbox" name="delID"
> > > value="<dtml-var id>"></TD>
> > > <TD align="left" width ="20%"><dtml-var message_subject></TD>
> > > <TD align="left" width ="5%"><dtml-var author></TD>
> > > <TD align="left" width ="5%"><FONT size=-2><dtml-var
> > > post_date></FONT></TD>
> > > </TR>
> > >
> > >
> > >
> > > Third part, the board_delProcessor
> > > -------------------------
> > > <dtml-with entries>
> > > <dtml-call "REQUEST.set('delObj',delID)">
> > > <dtml-call "manage_delObjects(delObj,REQUEST)">
> > > </dtml-with>
> > >
> > >
> > > This works on my message board management also for multiple posts
> > >
> > >
> > > hth,
> > >
> > > Jan
> > >
> > >
> > >
> > > --
> > > Jan@MountainbikeHQ.de
> > > http://www.MountainbikeHQ.de - Your home for DH, DS and CC Mountainbiking
> > >
> > > _______________________________________________
> > > Zope maillist - Zope@zope.org
> > > 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 - Zope@zope.org
> > 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 )