LOAD Component + Multiple Forms

328 views
Skip to first unread message

Marc Smith

unread,
Feb 15, 2011, 2:50:09 PM2/15/11
to web2py-users
Hi,

I am having trouble using the LOAD component with forms to produce a
"wizard" style multiple form type setup (eg, enter information on one
"screen", then go to the next, etc.).

If I move my mobile_verify.load file to mobile_verify.html and visit
http://localhost/myapp/default/mobile_verify/one -- the form seems to
work fine. When I keep it as a .load and it loads up in my layout, the
first form works fine, I click submit and it goes to the next form,
but the second form seems to be "stuck". When I click submit on the
second form (mobile_verify/two), it brings me back to the same form.
It appears request.vars is empty and thats why the .accepts returns
false and keeps me on that form?

In my controller I have this:
--snip--
@auth.requires_login()
def mobile_verify():
"""
Mobile phone number verification.
"""
# Make the user's phone number look nice
pretty_phone = '(' + auth.user.mobile[0:3] + ') '+ \
auth.user.mobile[3:6] + '-' + auth.user.mobile[6:10]

if request.args(0) == 'one':
# Form to pick verification method
vrfy_method_form = FORM(FIELDSET(INPUT(_type='radio',
_name='verify_method',
_value='SMS'),
'Send me a text (SMS)
message'),
FIELDSET(INPUT(_type='radio',
_name='verify_method',
_value='VOICE'),
'Call (voice) my mobile
phone'),
CENTER(INPUT(_id='text_me_button',
_type='submit',
_value='Text me!'),
INPUT(_id='call_me_button',
_type='submit',
_value='Call me!')))

if vrfy_method_form.accepts(request.vars, session):
#session.flash = 'vrfy_method_form accepted'
session.verify_method = request.vars.verify_method
redirect(URL('mobile_verify', args='two'))

return dict(vrfy_method_form=vrfy_method_form,
page_title='blah',
pretty_phone=pretty_phone)

elif request.args(0) == 'two':
# Form to check verification code
chk_code_form = FORM(CENTER(FIELDSET('Type the verification
code here:',

INPUT(_name='verify_code',

requires=IS_NOT_EMPTY())),
FIELDSET(INPUT(_type='submit'))))

if chk_code_form.accepts(request.vars, session):
#session.flash = 'chk_code_form accepted'
session.typed_code = str(request.vars.verify_code)
redirect(URL('mobile_verify', args='three'))

# Verification code
code = random.randint(100000, 999999)

return dict(pretty_phone=pretty_phone,
chk_code_form=chk_code_form,
code=code, page_title='blah')

elif request.args(0) == 'three':
return dict(page_title='blah', pretty_phone=pretty_phone)
--snip--

For my mobile_verify.load file:
--snip--
{{if request.args(0) == 'one':}}
<h4>How should we verify your mobile phone number?</h4>
<center>
My mobile phone: <strong>{{=pretty_phone}}</strong>
<br/>
<a href="{{=URL('user', args='profile')}}">Wrong phone number?</a>
</center>
<br/>
{{=vrfy_method_form}}
<script>
jQuery(document).ready(function() {
jQuery('#text_me_button').hide();
jQuery('#call_me_button').hide();
jQuery('input[name="verify_method"]').change(function() {
if (jQuery('input[name="verify_method"]:checked').val() == 'SMS')
{
jQuery('#call_me_button').hide();
jQuery('#text_me_button').show();
} else {
jQuery('#text_me_button').hide();
jQuery('#call_me_button').show();
}
});
});
</script>
{{elif request.args(0) == 'two':}}
{{if session.verify_method == 'SMS':}}
{{#SendSMS(auth.user.mobile, code)}}
An SMS text message has been sent to your mobile phone.
{{=code}}
{{else:}}
{{#OriginateCall(auth.user.mobile, code)}}
Your phone is ringing, please answer it.
{{=code}}
{{pass}}
{{session.verify_code = str(code)}}
{{=chk_code_form}}
{{elif request.args(0) == 'three':}}
{{if session.typed_code == session.verify_code:}}
<h4>Success!</h4>
You should now add some contacts. Click <a href="{{=URL('auth_user',
args='manage_contacts')}}">here</a> to manage your contacts.
{{else:}}
<h4>Sorry, but the code you entered didn't work.</h4>
Click <a href="{{=URL('auth_user', args='statistics')}}">here</a> to
try validating your phone again.
{{pass}}
{{pass}}
--snip--

For the view that calls the LOAD function:
{{extend 'layout.html'}}
<div id="box3" class="box-style">
<h2 class="title">{{=page_title}}</h2>
<div class="content">
{{if auth.user.phone_verified == False:}}
{{=LOAD(c='default', f='mobile_verify', args='one',
extension='load', ajax=True)}}
{{else:}}
<p>blah</p>
{{pass}}
</div>
</div>
--snip--

Help! Any ideas are greatly appreciated.

Version 1.91.6 (2011-01-03 17:55:14)


--Marc

Marc Smith

unread,
Feb 16, 2011, 10:14:07 PM2/16/11
to web2py-users
So, I've been experimenting with this a bit, and if I change the
form_name.accepts methods to using arguments like this:
form_name.accepts(request.vars, formname='blah1')

It acts a bit differently -- first form (one) is displayed and
accepted, and then second form (two) is displayed and when I fill in
the field and hit submit, it takes me back to the first form?

Is this proper use of the LOAD component, or should I not use my forms
with this function?


--Marc

villas

unread,
Feb 17, 2011, 1:05:50 PM2/17/11
to web2py-users
My first impression was that seem a lot of code in one function.
Maybe better to create some separate functions and redirect depending
on the form no. etc.

Your other strategy of loading the forms via ajax looks promising,
but it looks like it would always load 'one' in the example given:
{{=LOAD(c='default', f='mobile_verify', args='one', extension='load',
ajax=True)}}

I would recommend that you look at the admin app which comes with
web2py. Look at the controller 'wizard.py' and check out the views
etc. Spending a few minutes doing that may give you the inspiration
to take a slightly different approach. At least in making your code a
little cleaner.

-D

On Feb 17, 3:14 am, Marc Smith <msmith...@gmail.com> wrote:
> So, I've been experimenting with this a bit, and if I change the
> form_name.accepts methods to using arguments like this:
> form_name.accepts(request.vars, formname='blah1')
>
> It acts a bit differently -- first form (one) is displayed and
> accepted, and then second form (two) is displayed and when I fill in
> the field and hit submit, it takes me back to the first form?
>
> Is this proper use of the LOAD component, or should I not use my forms
> with this function?
>
> --Marc
>
> On Tue, Feb 15, 2011 at 2:50 PM, Marc Smith <msmith...@gmail.com> wrote:
> > Hi,
>
> > I am having trouble using the LOAD component with forms to produce a
> > "wizard" style multiple form type setup (eg, enter information on one
> > "screen", then go to the next, etc.).
>
> > If I move my mobile_verify.load file to mobile_verify.html and visit
> >http://localhost/myapp/default/mobile_verify/one-- the form seems to

Marc Smith

unread,
Feb 17, 2011, 3:38:08 PM2/17/11
to web...@googlegroups.com
On Thu, Feb 17, 2011 at 1:05 PM, villas <vill...@gmail.com> wrote:
> My first impression was that seem a lot of code in one function.
> Maybe better to create some separate functions and redirect depending
> on the form no. etc.

Sorry -- it started nice, but as I moved and tried different things,
it got a bit messy.


>
> Your other strategy of loading the forms via ajax looks promising,
> but it looks like it would always load 'one' in the example given:
> {{=LOAD(c='default', f='mobile_verify', args='one', extension='load',
> ajax=True)}}

Correct -- the first "page" (form one) it would always display is
mobile_verify/one (the start of the "wizard").


>
> I would recommend that you look at the admin app which comes with
> web2py.  Look at the controller 'wizard.py' and check out the views
> etc.  Spending a few minutes doing that may give you the inspiration
> to take a slightly different approach.  At least in making your code a
> little cleaner.

Yes, their example is very nice -- using separate functions for the
steps does make it look a lot cleaner, however, they aren't using the
LOAD feature for the wizard (the browser goes to a new URL for each
step).

Maybe the LOAD / AJAX stuff just doesn't work with multiple steps /
forms like I'm trying to do?
Has anyone ever gotten it to work this way?

Its not the end of the world, I can have the wizard go to new pages
each time, but I just wanted to try something different. =)


--Marc

Ovidio Marinho

unread,
Feb 17, 2011, 4:42:34 PM2/17/11
to web...@googlegroups.com
what makes your application, it sends sms:? you can share this application?, I need an application that sends SMS.

2011/2/15 Marc Smith <msmi...@gmail.com>



--
        Ovidio Marinho Falcao Neto
             ovid...@gmail.com
         Tecnologia da Informaçao
         Casa Civil do Governador
         83 3214 7885 - 88269088
                  Paraiba

Massimo Di Pierro

unread,
Feb 17, 2011, 4:46:11 PM2/17/11
to web2py-users
One solution is to send sms via emails. It is cheap, reliable and does
not rely on third party services:

web2py/gluon/contrib/sms_utils.py



On Feb 17, 3:42 pm, Ovidio Marinho <ovidio...@gmail.com> wrote:
> what makes your application, it sends sms:? you can share this application?,
> I need an application that sends SMS.
>
> 2011/2/15 Marc Smith <msmith...@gmail.com>
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > I am having trouble using the LOAD component with forms to produce a
> > "wizard" style multiple form type setup (eg, enter information on one
> > "screen", then go to the next, etc.).
>
> > If I move my mobile_verify.load file to mobile_verify.html and visit
> >http://localhost/myapp/default/mobile_verify/one-- the form seems to
>              ovidio...@gmail.com

Marc Smith

unread,
Feb 17, 2011, 5:00:56 PM2/17/11
to web...@googlegroups.com, Ovidio Marinho
I use a two-way SMS service from CDYNE and RESTful web API to send/receive.


--Marc

puercoespin

unread,
Feb 17, 2011, 7:06:10 PM2/17/11
to web2py-users
An exemple, please?

My mobile phone, 123456789, what's the code for sending a SMS?

On 17 feb, 22:46, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:
> One solution is to send sms via emails. It is cheap, reliable and does
> not rely on third party services:
>
> web2py/gluon/contrib/sms_utils.py
>
> On Feb 17, 3:42 pm, Ovidio Marinho <ovidio...@gmail.com> wrote:
>
>
>
>
>
>
>
> > what makes your application, it sends sms:? you can share this application?,
> > I need an application that sends SMS.
>
> > 2011/2/15 Marc Smith <msmith...@gmail.com>
>
> > > Hi,
>
> > > I am having trouble using the LOAD component with forms to produce a
> > > "wizard" style multiple form type setup (eg, enter information on one
> > > "screen", then go to the next, etc.).
>
> > > If I move my mobile_verify.load file to mobile_verify.html and visit
> > >http://localhost/myapp/default/mobile_verify/one--the form seems to

villas

unread,
Feb 17, 2011, 8:32:32 PM2/17/11
to web2py-users
If you are loading separate pages from the same site you may as well
redirect. Just use ajax to load small amounts of extra data within a
page. Your design, your choice :)

Re: SMS. I tried bulksms.com and it seemed really efficient, but I
suppose an SMS service is best chosen depending on what region you are
targeting.

On Feb 17, 8:38 pm, Marc Smith <msmith...@gmail.com> wrote:
> >> >http://localhost/myapp/default/mobile_verify/one--the form seems to

Anthony

unread,
Feb 17, 2011, 8:50:03 PM2/17/11
to web...@googlegroups.com
I haven't tried it, but here's my understanding:
 
You can send a text message simply by sending an email -- the email address is of the form [mobile_number]@[provider-specific_email_server]. For example, if the mobile number is 123-456-7890 and the provider is Sprint, you can send an SMS message by sending an email to 12345...@messaging.sprintpcs.com.
 
The sms_email function in sms_utils.py simply constructs the proper email address based on the phone number and mobile provider as arguments. You can then use that email address to send an email using the web2py Mail system: http://web2py.com/book/default/chapter/08#Auth-and-Mail. Obviously, you need to know the user's mobile provider (and there are a lot of choices) for this to work.
 
Anthony
 

On Thursday, February 17, 2011 7:06:10 PM UTC-5, puercoespin wrote:
An exemple, please?

My mobile phone, 123456789, what's the code for sending a SMS?

On 17 feb, 22:46, Massimo Di Pierro <massimo....@gmail.com>
wrote:
> One solution is to send sms via emails. It is cheap, reliable and does
> not rely on third party services:
>
> web2py/gluon/contrib/sms_utils.py
>
> On Feb 17, 3:42 pm, Ovidio Marinho <ovid...@gmail.com> wrote:
>
>
>
>
>
>
>
> > what makes your application, it sends sms:? you can share this application?,
> > I need an application that sends SMS.
>
> > 2011/2/15 Marc Smith <msmi...@gmail.com>
> >              ovid...@gmail.com

Massimo Di Pierro

unread,
Feb 17, 2011, 11:37:41 PM2/17/11
to web2py-users
mail.send(to=sms_email(number,provider),subject='...',message='...')

where number is the phone number and provide is the company the number
corresponds to

On Feb 17, 6:06 pm, puercoespin <jzaragoza.puercoes...@gmail.com>
wrote:
> An exemple, please?
>
> My mobile phone, 123456789, what's the code for sending a SMS?
>
> On 17 feb, 22:46, Massimo Di Pierro <massimo.dipie...@gmail.com>
> wrote:
>
>
>
>
>
>
>
> > One solution is to send sms via emails. It is cheap, reliable and does
> > not rely on third party services:
>
> > web2py/gluon/contrib/sms_utils.py
>
> > On Feb 17, 3:42 pm, Ovidio Marinho <ovidio...@gmail.com> wrote:
>
> > > what makes your application, it sends sms:? you can share this application?,
> > > I need an application that sends SMS.
>
> > > 2011/2/15 Marc Smith <msmith...@gmail.com>
>
> > > > Hi,
>
> > > > I am having trouble using the LOAD component with forms to produce a
> > > > "wizard" style multiple form type setup (eg, enter information on one
> > > > "screen", then go to the next, etc.).
>
> > > > If I move my mobile_verify.load file to mobile_verify.html and visit
> > > >http://localhost/myapp/default/mobile_verify/one--theform seems to

Martín Mulone

unread,
Feb 18, 2011, 5:51:31 AM2/18/11
to web...@googlegroups.com
Yes I do all the time, ajax is not an easy task. You have to remember, LOAD create an div id="a414s324s3214" (similar) and you have it in request.cid, if you want to update this component and you are in, you have to pass to the link the request.cid.

view/index.html

{{extend 'layout.html'}}
{{=LOAD('default','wizard.load', vars={'page': 1}, ajax=True)}}

view/wizard.load

{{=A('Page 2',_href=URL('default', 'wizard.load', vars={'page': 2}), cid=request.cid)

controller/default.py

def wizard():
   if request.vars.page==1:
       content='blabla'
   elif request.vars.page==2:
       content='blabla page2'
   return dict(content)


2011/2/17 Marc Smith <msmi...@gmail.com>



--
Pablo Martín Mulone (mar...@tecnodoc.com.ar)
Paraná, Entre Ríos, Argentina (CP 3100).

My blog: http://martin.tecnodoc.com.ar
Expert4Solution Profile: http://www.experts4solutions.com/e4s/default/expert/6


Bruno Rocha

unread,
Feb 18, 2011, 6:58:55 AM2/18/11
to web...@googlegroups.com
Ovidio, in Brazil the best paid service with an excelent JSON API for sending SMS is http://www.fastsms.com.br/


--
Bruno Rocha



2011/2/17 Ovidio Marinho <ovid...@gmail.com>

puercoespin

unread,
Feb 18, 2011, 7:22:52 AM2/18/11
to web2py-users
so, only number and provider information needed!

Seems easy.

Thanks all.

On 18 feb, 05:37, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:
> mail.send(to=sms_email(number,provider),subject='...',message='...')
>
> where number is the phone number and provide is the company the number
> corresponds to
>
> On Feb 17, 6:06 pm, puercoespin <jzaragoza.puercoes...@gmail.com>
> wrote:
>
> > An exemple, please?
>
> > My mobile phone, 123456789, what's the code for sending a SMS?
>
> > On 17 feb, 22:46, Massimo Di Pierro <massimo.dipie...@gmail.com>
> > wrote:
>
> > > One solution is to send sms via emails. It is cheap, reliable and does
> > > not rely on third party services:
>
> > > web2py/gluon/contrib/sms_utils.py
>
> > > On Feb 17, 3:42 pm, Ovidio Marinho <ovidio...@gmail.com> wrote:
>
> > > > what makes your application, it sends sms:? you can share this application?,
> > > > I need an application that sends SMS.
>
> > > > 2011/2/15 Marc Smith <msmith...@gmail.com>
>
> > > > > Hi,
>
> > > > > I am having trouble using the LOAD component with forms to produce a
> > > > > "wizard" style multiple form type setup (eg, enter information on one
> > > > > "screen", then go to the next, etc.).
>
> > > > > If I move my mobile_verify.load file to mobile_verify.html and visit
> > > > >http://localhost/myapp/default/mobile_verify/one--theformseems to

Marc Smith

unread,
Feb 18, 2011, 9:00:59 AM2/18/11
to web...@googlegroups.com, Martín Mulone
Hi Martín,

Yes, that works well for trapping links inside the component, but what
about using forms? Have you ever used multiple forms instead of links
from one page to another like you are doing below?


Thanks,

Marc

Marc Smith

unread,
Feb 18, 2011, 10:48:31 AM2/18/11
to mar...@tecnodoc.com.ar, Martín Mulone, web2py-users
On Fri, Feb 18, 2011 at 9:46 AM, Martín Mulone <mulone...@gmail.com> wrote:
> Ok, I think now I understood. Is a good question.
> Try something like this, never do a redirect() after accepts because web2py
> do full redirect. I don't know is something like this work:

The redirect inside of the LOAD component does seem to work fine --
when I click the submit button on the first page/form, it goes to the
next page/form inside of the DIV component (the whole page / URL is
NOT changed). The problem seems to do with using a second form inside
of the same DIV component -- the form doesn't submit properly or
something wrong with the second redirect.

I also noticed when I progress from the first form to the second, the
AJAX "flash" message appears, and then I click that box, it goes away
(the flash message), and then right after the same message is
displayed again, but instead of the fade in (like flash message uses),
it slides down like the error messages do. Crazy eh?

I don't know enough about JavaScript / AJAX, but I'm pretty confident
the problem lies there -- probably with the web2py_trap_form function.

I tested another theory, if in the LOAD function I specify the second
form/page as the start point, that form works fine (page two ->
three). So it seems its only an issue when having already had one form
completed and then trying to submit the next.

Again, this form wizard thing works fine when not using the LOAD component.


> form = SQLFORM(db.mywiz)
> if form.accepts(request.vars, session):
>    response.flash = 'form submitted'
>    form = LOAD('default','wizard.load', vars={'page': 2}, ajax=True)
> return dict(form=form)

This seems to create a second LOAD component inside the first DIV, so
not quite what I'm looking for.


--Marc
>
>
>
> 2011/2/18 Marc Smith <msmi...@gmail.com>

Richard Vézina

unread,
Feb 18, 2011, 12:34:35 PM2/18/11
to web...@googlegroups.com
Hello Martin,

How can I pass the right c23434646 (request.cid value?) to a jquery var so I can put the load into jQuery .dialog() and call it by menu entry??

For now I have this in layout :

    <link type="text/css" href="{{=URL('static','jquery-ui-1.8.9.custom/css/smoothness/jquery-ui-1.8.9.custom.css')}}" rel="stylesheet" /> 
    <!--<script type="text/javascript" src="{{=URL('static','jquery-ui-1.8.9.custom/js/jquery-1.4.4.min.js')}}"></script>--> <!--Conflict-->
    <script type="text/javascript" src="{{=URL('static','jquery-ui-1.8.9.custom/js/jquery-ui-1.8.9.custom.min.js')}}"></script>
    <script type="text/javascript">
       // --------------------------------------------------------------------
        jQuery.expr[':'].regex = function(elem, index, match) {
            var matchParams = match[3].split(','),
            validLabels = /^(data|css):/,
            attr = {
                method: matchParams[0].match(validLabels) ? 
                            matchParams[0].split(':')[0] : 'attr',
                property: matchParams.shift().replace(validLabels,'')
            },
            regexFlags = 'ig',
            regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
            return regex.test(jQuery(elem)[attr.method](attr.property));
        };
       // --------------------------------------------------------------------
    
        $(document).ready(function(){           
            $('div:regex(id,^c[0-9]*$)').dialog({
                    autoOpen: false,
                    height: 300,
                    width: 300,
                });
               $( 'a[href="/id_sequence_test/default/question1"]' )
                   .replaceWith('<a>test</a>')
               $( 'a:contains(test)' )
                   .click(function() {
                       $('div:regex(id,^c[0-9]*$)').dialog( "open" );
                    });
                    // remove the title bar
                    //$('.ui-dialog-titlebar').hide();
        });
    </script>   

It lets me popup in .dialog() box this LOAD :

default/index :
{{=LOAD('default','question.load',ajax=False)}}


But I can't be specific to a my loaded component with this basic regex :
div:regex(id,^c[0-9]*$)

So I can't have more then one LOAD in a page at a time...

thanks

Richard

On Fri, Feb 18, 2011 at 5:51 AM, Martín Mulone <mulone...@gmail.com> wrote:

Marc Smith

unread,
Feb 18, 2011, 1:53:17 PM2/18/11
to mar...@tecnodoc.com.ar, carlos...@gmail.com, Martín Mulone, web2py-users
Wow! I just found this post:
http://groups.google.com/group/web2py/browse_thread/thread/27bf920f49fc8504/510cd7d66f9a4ccb
I tried this and it fixes my problem!

Carlos: Is this fine to keep the response stuff in there? And to keep
the web2py_ajax.html modifications? It won't affect other forms or
anything else?


Thanks!


--Marc

On Fri, Feb 18, 2011 at 12:48 PM, Martín Mulone <mulone...@gmail.com> wrote:
>> This seems to create a second LOAD component inside the first DIV, so
>> not quite what I'm looking for.
>

> You are right my bad, let me think about it.
> 2011/2/18 Marc Smith <msmi...@gmail.com>

Carlos

unread,
Feb 18, 2011, 2:06:12 PM2/18/11
to web2py-users
Hi Marc,

I believe my fix does not break anything, but much more testing is
certainly required to be sure.

If you find problems, please let me know.

If there are no problems after testing, I believe this fix should be
included in web2py ... Massimo?.

https://groups.google.com/forum/?fromgroups#!topic/web2py/J7-SD0n8hQQ

Regards,

Carlos


On Feb 18, 12:53 pm, Marc Smith <msmith...@gmail.com> wrote:
> Wow! I just found this post:http://groups.google.com/group/web2py/browse_thread/thread/27bf920f49...
> I tried this and it fixes my problem!
>
> Carlos: Is this fine to keep the response stuff in there? And to keep
> the web2py_ajax.html modifications? It won't affect other forms or
> anything else?
>
> Thanks!
>
> --Marc
>
>
>
>
>
>
>
> On Fri, Feb 18, 2011 at 12:48 PM, Martín Mulone <mulone.mar...@gmail.com> wrote:
> >> This seems to create a second LOAD component inside the first DIV, so
> >> not quite what I'm looking for.
>
> > You are right my bad, let me think about it.
> > 2011/2/18 Marc Smith <msmith...@gmail.com>
>
> >> On Fri, Feb 18, 2011 at 9:46 AM, Martín Mulone <mulone.mar...@gmail.com>
> >> > 2011/2/18 Marc Smith <msmith...@gmail.com>
>
> >> >> Hi Martín,
>
> >> >> Yes, that works well for trapping links inside the component, but what
> >> >> about using forms? Have you ever used multiple forms instead of links
> >> >> from one page to another like you are doing below?
>
> >> >> Thanks,
>
> >> >> Marc
>
> >> >> On Fri, Feb 18, 2011 at 5:51 AM, Martín Mulone
> >> >> <mulone.mar...@gmail.com>
> >> >> wrote:
> >> >> > Yes I do all the time, ajax is not an easy task. You have to
> >> >> > remember,
> >> >> > LOAD
> >> >> > create an div id="a414s324s3214" (similar) and you have it in
> >> >> > request.cid,
> >> >> > if you want to update this component and you are in, you have to pass
> >> >> > to
> >> >> > the
> >> >> > link the request.cid.
> >> >> > view/index.html
>
> >> >> > {{extend 'layout.html'}}
>
> >> >> > {{=LOAD('default','wizard.load', vars={'page': 1}, ajax=True)}}
>
> >> >> > view/wizard.load
>
> >> >> > {{=A('Page 2',_href=URL('default', 'wizard.load', vars={'page': 2}),
> >> >> > cid=request.cid)
>
> >> >> > controller/default.py
>
> >> >> > def wizard():
>
> >> >> >    if request.vars.page==1:
>
> >> >> >        content='blabla'
>
> >> >> >    elif request.vars.page==2:
>
> >> >> >        content='blabla page2'
>
> >> >> >    return dict(content)
>
> >> >> > 2011/2/17 Marc Smith <msmith...@gmail.com>
> >> >> >> >> >http://localhost/myapp/default/mobile_verify/one--the form
> >> >> >> >> >    elif...
>
> read more »
Reply all
Reply to author
Forward
0 new messages