It could be pretty straight forward - as Leonel says, you would use 
Javascript / Ajax. If you rolled your own autocomplete you would have a 
controller in default (for example) and the layout would refer back to that 
controller. Doesn't matter what page you are looking at, the Ajax call is 
always back to the 'default' controller.

Have a look at the jQuery / Ajax section of the 
book: http://web2py.com/books/default/chapter/29/11/jquery-and-ajax

There's even a built-in autocomplete in web2py which might 
suit: 
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Auto-completion

On Wednesday, 18 November 2015 09:40:26 UTC+1, Johann Spies wrote:
>
> As I understand Web2py forms in views are managed by controllers.
>
> I want to use a search form in the menubar like the  attached image.
>
> [image: Inline images 1]
>
> This form is presented by layout.html.
>
> I want the form to be an auto-complete widget with sql-lookups in the 
> background.
>
> So from where do I control that form?  From a model?
>
> The form must be available from all parts of the app. I do not want to add 
> code in every controller to manage it.
>
> Regards
> Johann
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to