I'm having difficulty with my loaded component and bootstrap modal. I have
it working except that depending on how I code it I get 1 of 2 undesired
behaviors.
If I have the following in my controller:
if qcForm.process(formname='qcForm').accepted:
rfLevel = qcForm.vars.rfLevel
phLevel = qcForm.vars.phLevel
workorder = db.workorder(workorderId)
workorder.update_record(rfLevel=rfLevel,
phLevel=phLevel)
url = URL('applications', 'production', args=('view','workorder',
workorderId),
user_signature=True)
redirect(url)
It behaves just fine when there is an error in the modal form, it
redisplays the form with the error. But, if it accepts the form and
updates, it redirects to the URL in the modal window. I want it to refresh
the entire page with the url.
If I take the redirect out of the controller and put it in javascript like
this:
<button type="submit" onClick="$('#qcForm').submit();window.location.
href='{{=URL('applications','production',args=['view','workorder
',workorderId],user_signature=True)}}'" class="btn btn-primary">
Then my redirect works fine when the form is accepted, but now it doesn't
redisplay the form if there is an error.
I understand why these two scenarios work the way they do, but I can't come
up with a way to make the loaded bootstrap modal form both:
* display errors when it needs to
* redirect to an entirely new page (not in the modal) on sucessful
submission
I've read through some other posts regarding components in a bootstrap
modal form, but nothing specifically addressing this issue.
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.