Sorry for the slow response. From within my main view, at the end, I do this: <script> $(document).ready(function() { {{if auth.is_logged_in() and session.state:}} $("#mydialog").dialog("open"); web2py_component("{{= URL('mycontroller', 'index')}}", "mydialog"); {{pass}} }); </script>
As I write this, I'm remembering how I once wondered why web2py_component doesn't have a user_signature parameter? But that maybe is unrelated to this discussion ('tho if you have an answer to that question, too, it would be nice to know). So basically, if a dialog is open to a particular form and the user hits reload, the main page sees that there's a state variable so it opens a dialog and squirts the appropriate form back into the dialog. But then, the form won't self-submit. On Friday, November 22, 2013 10:05:19 PM UTC+8, Anthony wrote: > > I tried your code and it works fine for me. Maybe we need to see more of > the code and understand the workflow better. > > On Friday, November 22, 2013 7:55:50 AM UTC-5, weheh wrote: >> >> It works like this: >> >> # index controller >> def index(): >> # some preamble >> if session.state == 'a': >> redirect(URL('thiscontoller', 'myfunc1.load', user_signature=True >> )) >> # some more states and redirects >> >> #later on >> @auth.requires_signature() >> def myfunc1(): >> form = SQLFORM.factory(Field(...the usual stuff, nothing fancy...), >> Field(...), Field(...)) >> if form.process().accepted: >> # process form >> elif form.errors: >> response.flash = 'error' >> return dict(html=form) >> >> >> If myfunc1 is called directly it self-submits fine. But if is reached via >> the index function, which is triggered by a page reload, the form won't >> self submit. Hope that clarifies. Must be something really dumb-a** simple >> but I'm not seeing it. >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.