If there is nothing to load initially, you don't need the {{=LOAD(...)}} at
all. For ajax components, all LOAD() does is create a div with the
"Loading..." message in it and a script element with a call to
web2py_component() to fill the div with the component. In this case, you
are creating the div yourself, and you're using a user-generated event
(menu item selection) to fill the div, so no need for LOAD().
Note, the component content retrieved via Ajax will replace the entire
contents of your "component-pane" div, so don't put any additional div
structure inside that div, as it will simply be replaced. Instead, place
the "component-pane" div wherever in the layout structure you want the
component to be inserted.
Anthony
On Friday, May 25, 2012 3:07:35 AM UTC-4, Annet wrote:
>
> I have a view site/index.html which extends site/generic.html which
> extends scaffold.html.
>
> scaffold.html contains the <head></head> and <body></body> tags. The body
> only contains {{inlcude}}
>
> site/generic.html contains the site header and footer and a
> <container></container> tag containing {{include}}
>
> I have groups of functions, these groups are menu items in a navigation
> bar. I'd like the dropdown menus to have ajax functionality, so in the code
> that renders the dropdown menus I have:
>
> <a onclick="web2py_component('{{=_link}}',
> 'component-pane')">{{=_name}}</a>
>
> which renders the following items:
>
> <a onclick="web2py_component('/bootstrap/calendar/openingHours/283',
> 'component-pane')">Opening hours</a>
>
>
> The problem is that I don't know where to put the component-pane:
>
> <div id="component-pane"
> <div class="row-fluid">
> <div class="span7">
> {{=LOAD()}}
> </div> <!-- /span -->
> <div class="span5">
> </div> <!-- /span -->
> </div> <!-- /row -->
> </div> <!-- /component-pane -->
>
> and what to put in the {{=LOAD()}}, for initially there is nothing to
> load, this depends on which item in dropdown menu is being clicked.
>
>
> Regards,
>
> Annet
>