Thank you, but if I use "next" or "redirect" in my component's controler, 
the redirection is done in the component, not in the page that contains the 
component.

For example, I have : 
-"Page1" which contains "component1"

If I put redirect(URL('Page2')) in my "component1"'s controller, I will see:
-"Page1" which contains "Page2"

And I just want to see "Page2"

Any idea?

Le jeudi 31 janvier 2013 14:03:47 UTC+1, Lamps902 a écrit :
>
> Why not use the process() method's "next" parameter? 
> http://web2py.com/books/default/chapter/29/07?search=.accepted#The-process-and-validate-methods
>
> Otherwise, there's "redirect()" - 
> http://web2py.com/books/default/chapter/29/07?search=redirect%28#Forms-and-redirection
>  
>
> On Thursday, January 31, 2013 4:18:37 AM UTC-5, Loïc wrote:
>>
>> Hello All,
>>
>> I have a question about my application organized as follows:
>> *A "main" page : render_page
>> *A component "load_newsletter". This component displays a form with an 
>> "email" field and a "submit button"
>>
>> What I want to do : 
>> When the user fill the form in my component load_newsletter, I want to 
>> redirect the "main" page to an other page (full_newsletter)
>> This other page contains a more complete form to add some information
>>
>> I don't know if I can redirect the page which contains a component, from 
>> inside this component?
>>
>> Example of code:
>>
>> ######  View "render_page.html"  ######
>> {{extend 'layout.html'}}
>> {{block right_sidebar}}
>>     {{=LOAD('default','load_newsletter.html',ajax=True)}} 
>> {{end}}
>> ###################################
>>
>> ######  Controller "load_newsletter"  ######
>> form=FORM(DIV(T('Your email'), _class='blueText'),
>>                 INPUT(_name='email', _type='email', 
>> requires=IS_NOT_EMPTY()),
>>                 INPUT(_type='submit'))
>>     if form.process().accepted:
>>         # >>>>> Here I want to redirect the page which contains me to 
>> "full_newsletter" <<<<<
>>     elif form.errors:
>>         response.flash = T('There was an error in the form')
>>     return dict(form=form)
>> #######################################
>>
>> Thank you for your help
>>
>>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to