A lot of thing happen since that time... Here the solutions I found with
help of Anthony :

if form.accepts(request.vars, session):
        session.flash = T('form accepted')
        """if table == 'ref_fnaregistry':
            next = URL('ref', 'creation', args=1, extension=False,
host=True)
        elif table == 'ref_vregistry':
            next = URL('ref', 'creation', args=2, extension=False,
host=True)
        elif table == 'ref_tregistry':
            next = URL('ref', 'creation', args=3, extension=False,
host=True)
        response.js = 'window.location.replace("%s")' % next""" # With
redirection (only a problem with the nav back arrow not working)
        if table == 'ref_fnaregistry':
            response.js="web2py_component('%s','two');" %
URL('ref','create_fvte',args='ref_vregistry')
            response.js+="web2py_component('%s','three');" %
URL('ref','create_fvte',args='ref_tregistry')
        elif table == 'ref_vregistry':
            response.js="web2py_component('%s','three')" %
URL('ref','create_fvte',args='ref_tregistry')
        elif table == 'ref_tregistry':
            response.js="web2py_component('%s','four')" %
URL('ref','create_fvte',args='ref_eregistry') # Without "redirection" to
make sure the next coming component is updated

Note that the commented line breake the navigator workflow and the back
arrow not working... I do prefer to not redirect the user...

Thanks Cliff.


Richard



On Mon, Jul 11, 2011 at 6:20 PM, Cliff <cjk...@gmail.com> wrote:

> Hello Richard,
>
> Your post and Massimo's reply helped me understand better how this is
> supposed to work.  So maybe I can return the favor a little bit.
>
> I understand from your posts that you have a field on tab_1 and you
> would like to see the contents of that field included in a dropdown on
> tab_2.  I'm assuming that if there is a value in this field it causes
> DAL to insert a row into some table.  Are these inserts actually
> taking place?  If they're not, I don't have an answer for that because
> I haven't tackled yet how to make a tab click do the work of a submit.
>
> On the other hand, if the values are getting into the required table
> and you don't see them in the drop down I may be able to help.  All of
> your LOAD calls point to the same 'create_fvte', which means that they
> are fetching the same load file from the view directory.  What's
> working for me so far is to have a separate load file for each tab,
> with a separate function to fetch and render the data.
>
> Please excuse my pseudocode.  What's working for me looks something
> like this:
>
>
> ----------------------------------------------------------------------------------------------------
> Controller foobar.py:
> def foo():
>    allfoos = db.foo.select(id>0)
>    return dict(allfoos=allfoos)
>
> def bar():
>    allbars = db.bar.select(id>0)
>    return dict(allbars = allbars)
>
>
> ------------------------------------------------------------------------------------------------------
> view foo.load:
> {{for eachfoo in allfoos:}}
>    {{ # do something }}
> {{pass}}
>
>
> ------------------------------------------------------------------------------------------------------
> view foobar.html
> .
> .
> .
> <div id="tabs">
>    <ul>
>        <li><a href="#tabs-1">{{=T('foo').capitalize()}}</a></li>
>        <li><a href="#tabs-2">{{=T('bar').capitalize()}}</a></li>
>     </ul>
>    <div id="tabs-1">
>         {{=LOAD(c='foobar', f='foo', ajax=True, target='tabs-1')}}
>    </div>
>    <div id="tabs-2">
>        {{=LOAD(c='foobar', f='bar', ajax=True, target='tabs-2')}}
>    </div>
> .
> .
> .
> Good luck.
>
> On Jun 6, 11:32 am, Richard Vézina <ml.richard.vez...@gmail.com>
> wrote:
> > Hello Massimo,
> >
> > Was it available in 1.94.6??
> >
> > I try all sort of things and can't makes it work... No refresh.
> >
> > Richard
> >
> > On Fri, Jun 3, 2011 at 10:02 AM, Massimo Di Pierro <
> >
> >
> >
> >
> >
> >
> >
> > massimo.dipie...@gmail.com> wrote:
> > > Give a name to your components
> >
> > > {{=LOAD(...,target='one')}}
> > > {{=LOAD(...,target='two')}}
> > > {{=LOAD(...,target='three')}}
> >
> > > now any action can trigger a component reload
> >
> > > response.js="web2py_component('action','target')"
> >
> > > where action is the URL of the component and 'target' is 'one', 'two',
> > > 'three'', etc.
> >
> > > On Jun 2, 4:21 pm, Richard Vézina <ml.richard.vez...@gmail.com> wrote:
> > > > Hello,
> >
> > > > Here my view code :
> >
> > > > {{extend 'layout_form.html'}}
> >
> > > > <style type="text/css" title="currentStyle">
> > > > @import
> >
> > >
> "{{=URL('static','plugin_added/jquery-ui-1.8.9.custom/development-bundle/th
> > > emes/base/jquery.ui.all.css')}}";
> > > > </style>
> >
> > > > <script type="text/javascript" charset="utf-8"
> >
> > >
> src="{{=URL('static','plugin_added/jquery-ui-1.8.9.custom/js/jquery-1.4.4.m
> > > in.js')}}"></script>
> > > > <script type="text/javascript" charset="utf-8"
> >
> > >
> src="{{=URL('static','plugin_added/jquery-ui-1.8.9.custom/development-bundl
> > > e/ui/jquery.ui.core.js')}}"></script>
> > > > <script type="text/javascript" charset="utf-8"
> >
> > >
> src="{{=URL('static','plugin_added/jquery-ui-1.8.9.custom/development-bundl
> > > e/ui/jquery.ui.widget.js')}}"></script>
> > > > <script type="text/javascript" charset="utf-8"
> >
> > >
> src="{{=URL('static','plugin_added/jquery-ui-1.8.9.custom/development-bundl
> > > e/ui/jquery.ui.tabs.js')}}"></script>
> > > > <script>
> > > > $(function() {
> > > >     $( "#tabs" ).tabs();});
> >
> > > > </script>
> >
> > > > <div class="demo">
> > > > <br/>
> > > > <br/>
> > > > <br/>
> > > > <div id="tabs">
> > > >     <ul>
> > > >         <li><a href="#tabs-1">{{=T('folder').capitalize()}}</a></li>
> > > >         <li><a href="#tabs-2">{{=T('volume').capitalize()}}</a></li>
> > > >         <li><a href="#tabs-3">{{=T('tome').capitalize()}}</a></li>
> > > >         <li><a href="#tabs-4">{{=T('report').capitalize()}}</a></li>
> > > >     </ul>
> > > >     <div id="tabs-1">
> > > >     <br/>
> >
> > >
> {{=LOAD(c='ref',f='create_fvte',args='ref_fnaregistry',extension='load',aja
> > > x=True,ajax_trap=False)}}
> > > >     </div><!-- tabs-1 -->
> > > >     <div id="tabs-2">
> > > >     <br/>
> >
> > >
> {{=LOAD(c='ref',f='create_fvte',args='ref_vregistry',extension='load',ajax=
> > > True,ajax_trap=False)}}
> > > >     </div><!-- tabs-2 -->
> > > >     <div id="tabs-3">
> > > >     <br/>
> >
> > >
> {{=LOAD(c='ref',f='create_fvte',args='ref_tregistry',extension='load',ajax=
> > > True,ajax_trap=False)}}
> > > >     </div><!-- tabs-3 -->
> > > >     <div id="tabs-4">
> > > >     <br/>
> >
> > >
> {{=LOAD(c='ref',f='create_fvte',args='ref_eregistry',extension='load',ajax=
> > > True,ajax_trap=False)}}
> > > >     </div><!-- tabs-4 -->
> > > > </div><!-- tabs -->
> >
> > > > </div><!-- End demo -->
> >
> > > > The problem is that when the form loaded with component in tab-1 is
> > > submited
> > > > and the user clic on tab-2 to fill the following form... The
> component is
> > > > not up to date... So the new entry just made into the preceding form
> is
> > > not
> > > > available to be pick in the second form dropbox...
> >
> > > > Is there a way to send a refresh component command on tab-2 clic or
> > > > something?? Or the only solution be to add a refresh button that to
> force
> > > > component reload??
> >
> > > > Thanks
> >
> > > > Richard
>

Reply via email to