Something like this might work for you.

        --- Pat
Public void doDeletes(IRequestCycle cycle) {
Enumeration en = cycle.getRequestContext().getRequest()
                                .getParameterNames();
                ArrayList keys = new ArrayList();
                while (en.hasMoreElements()) {
                        String s = (String) en.nextElement();
                        String value =
cycle.getRequestContext().getParameter(s);

                        if (s.startsWith(FastGrid.POST_HEADER)) {
                                String id =
s.substring(FastGrid.POST_HEADER.length());
                                if (value.equals("on"))
                                        keys.add(id);
                        }
                }
                if (keys.size() > 0) {
                        HibHelper.beginTransaction();
                        Criteria c =
HibHelper.getSession().createCriteria(fObjectClass);
                        c.add(Expression.in("id", keys));
                        List l = c.list();
                        for (int x = 0; x < l.size(); x++) {
                                HibHelper.getSession().delete(l.get(x));
                        }
                        HibHelper.commitTransaction();
                        fMessage = "Successfully deleted " + l.size() + "
records.";
                }               

> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Ron Piterman
> Sent: Monday, September 12, 2005 4:30 AM
> To: [email protected]
> Subject: Re: How to avoid rewind a list?
> 
> Forms in Tapestry always rewind. If you don't want to get the list from
> the database again, you can "persist" it in the session.
> 
> ציטוט Jun Tsai:
> > hi ,all
> > I have a form includes a checkbox group component.I find If I submit the
> > form,it will call my getListData method again.How to avoid this?I want
> to
> > get the checkbox value(primary key value) only!
> > Thanks.
> > Jun Tsai
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to