{{=LOAD('controller','action.load',vars={},args=[],ajax=True)}}
in the layout.html
and something like this
form=SQLFORM.factory(
Field(...),
Field(...),
Field(...),
formstyle='table2cols',submit_button='Vyhľadať')
if form.accepts(request.vars, session):
redirect(URL(r=request,
f='2action',vars={'typ':typ}))
in action controlller.
It almost works, but instead of redirection to '2action', it displays
2action page in the space where previously the form was. URL is not
changed.
Is this expected behaviour?
How to correctly do real redirection to 2action page?
Julius
I am not able to make it work.
Firstly, just little note, my original
url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ,
'okres':request.vars.okres, 'druh':request.vars.druh})
can not be used because it returns
/app/default/nehnutelnosti.load?okres=1&typ=1&druh=2
so it probably rightly doesn't redirect to the new page.
Secondly, I tried for testing purposes to construct url 'by hand', both
versions:
1.
http://127.0.0.1:9999/app/default/nehnutelnosti?okres=1&typ=1&druh=2
2.
/app/default/nehnutelnosti?okres=1&typ=1&druh=2
Form disappears, but that is all what happens after submit.
Form looks following in the page source:
<script type="text/javascript"><!--
web2py_component("/real/default/form.load","c712094659208")
//--></script><div id="c712094659208">loading...</div>
What else could be the problem with redirection?
Julius
V Štvrtok, 5. august 2010 o 15:23 -0700, mdipierro napísal(a):
> > url=URL(r=request, f='nehnutelnosti',vars={'typ':request.vars.typ, 'okres':request.vars.okres, 'druh':request.vars.druh})
> > can not be used because it returns
> > /app/default/nehnutelnosti.load?okres=1&typ=1&druh=2
>
> if you you can specify URL(....,extension='html')
url=URL(r=request, f='nehnutelnosti', vars={'typ':request.vars.typ,
'okres':request.vars.okres, 'druh':request.vars.druh},extension='html')
not change, result is still
/app/default/nehnutelnosti.load?okres=1&typ=1&druh=2
MAIN problem is the redirect doesn't work:
if form.accepts(request.vars, session):
url="/"+request.application
+"/default/nehnutelnosti.html?okres="+request.vars.okres
+"&typ="+request.vars.typ+"&druh="+request.vars.druh
raise HTTP(303,**{'web2py-component-command':'document.location="%s"'%
url})
Julius
I got current trunk this way:
hg clone https://web2py.googlecode.com/hg/ web2py078a
requesting all changes
adding changesets
adding manifests
adding file changes
added 764 changesets with 2180 changes to 733 files
updating to branch default
588 files updated, 0 files merged, 0 files removed, 0 files unresolved
It identifies itself as Version 1.82.1 (2010-08-04 18:57:33).
Attached you can find the application as I typed it from your email.
Julius
V Sobota, 7. august 2010 o 10:58 -0700, mdipierro napísal(a):
It works on Firefox, Chromium, Konqueror.
it doesn't on Opera 10.60 and Epiphany, Midori (both are based on WebKit
rendering engine)
Hope this helps.
Julius
V Sobota, 7. august 2010 o 16:29 -0700, mdipierro napísal(a):
V Pondelok, 9. august 2010 o 01:28 -0700, mdipierro napísal(a):
Details:
Epiphany has Webinspector which allowed me to run JS with debugging
enabled. It didn't throw any error while doing that.
Opera has its Dragonfly which does similar things. Neither it reported
any error.
Just to note:
Opera behaves differently from Epiphany. In Epiphany, the form
disappears after submission, in Opera nothing happens, screen remains as
it was in beginning.
Julius
V Pondelok, 9. august 2010 o 02:23 -0700, mdipierro napísal(a):
I got a message from a friend telling me the form isn't displayed in IE8
at all.
It is from my application available at http://93.184.68.161:9999/real
If you would like to see the response from the search you need to choose
Predaj
Prievidza
2-izbovy byt
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; .NET4.0E)
Timestamp: Tue, 10 Aug 2010 07:05:34 UTC
Message: Invalid argument.
Line: 116
Char: 165
Code: 0
URI: http://93.184.68.161:9999/real/static/jquery.js
Did you see the form working in an IE? Which version?
Julius
V Pondelok, 9. august 2010 o 13:20 +0200, Julius Minka napísal(a):
V Utorok, 10. august 2010 o 10:07 +0200, Julius Minka napísal(a):