OK, now I see. Maybe just add a call to web2py_component() to the document ready handler:
{{if show_tab:}} <script type="text/javascript"> $(document).ready(function(){ web2py_component('{{=URL('site', show_function, args=session.id)}}',show_tab ); $('a[href=#{{=show_tab}}]').tab('show'); }); </script> {{pass}} You'll have to add some logic to set the value of the show_function variable included in the call to URL(). Anthony On Friday, July 6, 2012 1:57:46 AM UTC-4, Annet wrote: > > Hi Anthony, > > I believe that's what my code does. This line: >> >> {{show_tab = this_tab if not show_tab else show_tab}} >> >> sets the value of show_tab to the first tab (if any) that gets written to >> the view. Is that not what you want? >> > > Yes, that's what I want, however, I also want the content of the first tab > if any to be loaded. This is what the code does: > > <div class="tab-content"> > <div id="tab-0" class="tab-pane active"></div> > <div id="tab-1" class="tab-pane"></div> > <div id="tab-2" class="tab-pane "></div> > </div> > > > This is what it should do: > > <div class="tab-content"> > <div id="tab-1" class="tab-pane active"> > <p>Text</p> > <table>Table content</table> > </div> > <div id="tab-2" class="tab-pane"></div> > <div id="tab-3" class="tab-pane "></div> > </div> > > > Kind regards, > > Annet > > >