The problem is that doing a POST to a url with GET variables is
problematic since it is not in the html specs and different browsers
may behave in different ways. It should be avoided. The solution is to
pass request.vars.OF as a hidden form variable

FORM(....,hidden=dict(OF=CodeOF))


On Mar 17, 2:43 pm, JmiXIII <[email protected]> wrote:
> Here I am once again.
> I've tried to find the explanation of the following fact but did not
> manage.
>
> I Have the following code in my controller:
>
> def saisie():
> ...
>     CodeOF=request.vars.OF or request.vars.META_OF
>     Selection=FORM('Code OF:',
> INPUT(_name='OF',_value=CodeOF,requires=IS_IN_DB(db, 'GPOF.OF_CODE')),
> o INPUT(_type='submit',_value='Cliquer pour afficher'))
> #Formulaire de filtre
>     if Selection.accepts(request.vars,keepvalues=True):
>         pass
> ...
>
> It helps me filtering the view. Anyway when I submit the url is
> something /SuiviProd/default/saisie. I still wonder why it is not /
> SuiviProd/default/saisie?OF=xxxx . But that works fine
>
> The pb is I need to access to this view from elsewhere passing the
> vars=dict(OF=xx). So I get the rendered view : /SuiviProd/default/
> saisie?OF=xx , the view is correct. But If submit Selection again then
> web2py complains about the fact :
>
> TypeError: int() argument must be a string or a number, not 'list'
>
> I guess that resquest.vars get the vars url and the Selection vars. I
> tried using request.post_vars but that is the same. So my question is
> how can I pass my vars without the url (as it is done via the saisie
> fonction)
>
> Hope you understood me.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to