STUPENDOUS!  Thank you Anthony!  Is there a wiki or Q&A site somewhere for 
these little tidbits of knowledge?  The manual is fantastic but too 
exhaustive for a quick answer for me anyway... if not maybe I'll build one 
on web2py;)

On Sunday, August 4, 2013 8:21:52 AM UTC-4, Anthony wrote:
>
>
> So the usual button to redirect to another page I use this
>>
>> <button type="button" class="btn btn-primary" 
>> onclick="location.href='{{=URL('gameTime')}}'">Done with my squares</button>
>>
>>
>> What I am trying to do is click a button that does NOT redirect.  If I 
>> use a function in defauly.py that has no view in the URL field above, it 
>> loads the generic view as advertised.  Grrr.  Isn't there just a simple way 
>> to suppress calling the generic view?  Just leave the view and retreat into 
>> the controller for a little code parsing? ;)
>>
>
> First, generic views are disabled by default (though enabled on localhost 
> in the welcome app via a line in db.py). Second, views are only called if 
> your controller action returns a dictionary -- so just don't return a 
> dictionary.
>
> <button type="button" class="btn btn-primary" onclick="jQuery.ajax(
> '{{=URL('gameTime')}}');">Done with my squares</button>
>
> def gameTime():
>     [do something]
>     return 'OK'
>
> Anthony
>
>

-- 

--- 
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.


Reply via email to