[Zope3-Users] keeping GET data in a formlib based form

Lorenzo Gil Sanchez lgs at sicem.biz
Wed Mar 14 03:55:44 EDT 2007


Hi everybody,

I have a formlib based form. It is not accesible from an application
menu because it is part of a wizard like process.

The first time it gets called the url looks something like this:

http://localhost:8080/myapp/mycontent/myform?myarg=23

So in the update() method of the form I read the myarg argument from the
request and use it to setup some widgets in a particular way.

The problem is that when the action buttons of the form are clicked, and
the form is reloaded, the 'myarg' argument is lost and I run into
problems.

I need a way to keep 'myarg' information in my form for subsequent
calls. Ideally I would like some mechanism that ends writing an <input
type="hidden" id="myarg" value="23"/> tag in the html because that way
my code:

def update(self):
  [..]
  data = self.request['myarg']
  [..]

will still work, right?

I have thought about extending the formlib template to just do that or
maybe adding a form.Field to my form with a special Widget associated to
it. No idea of what's the best aproach.

Anyone has pointer for this?

thanks

Lorenzo Gil



More information about the Zope3-users mailing list