Hi,

Thanks for the pointer! It helped me to get it figured out! Here is the snippet:

from Products.Five.formlib.formbase import PageForm
from my.product.interfaces import ISimuladorForm

class SimuladorForm(PageForm):
    form_fields = form.FormFields(ISimuladorForm)
    form_reset = False

    def render(self):
        """ update() method sets Formlib.form_reset to True. That causes
        Formlib.render() to call Formlib.resetForm()
        We just set form_reset to false and call render() again.
        """
        self.form_reset = False
        return super(PageForm,self).render()


And, that's it.
---
Noe

2011/3/3 Vitaliy Podoba <[email protected]>
>
> Hi,
>
> I think you have to customize 'update' method in your form class and not
> set 'form_reset' attribute to True when form is successfully posted and
> validated. Or take a look into EditFormBase class which, I believe,
> shouldn't reset form after saving data.
>
> Regards,
> Vitaliy Podoba
>
>
> In article
> <[email protected]>,
>  Noe Misael Nieto Arroyo <[email protected]>
>  wrote:
>
> > I'm working on a zope.formlib for Plone 4. Validation works fine and after I
> > submit it (it submits to itself) the results are displayed below all the
> > form fields.
> >
> > The problem is that, now that the results have been displayed, the
> > information I put in the fields is no longer there. I have to fill-in the
> > form again in order to retrieve more results.
> >
> > How do I make my PageForm to "remember" the field values between requests?
> >
> > --
> > Noe
> > PD: (Can paste code if needed)
> > ---------------------------------------------------------------------
> > _______________________________________________
> > Product-Developers mailing list
> > [email protected]
> > https://lists.plone.org/mailman/listinfo/product-developers
>
> _______________________________________________
> Product-Developers mailing list
> [email protected]
> https://lists.plone.org/mailman/listinfo/product-developers
_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/product-developers

Reply via email to