If you don't want to use the nested load, you can also do this:
form = SQLFORM(db.mytable);
dialog = modal_wrapper(form, _id='*cont_id*', header='Header',
footer='footer')
Works just fine.
On Friday, February 12, 2016 at 4:40:09 PM UTC-5, billmac...@gmail.com
wrote:
>
> I got to tell
In the book it says load in the view. Nothing in the controller. I was
just wondering if we can add a button in the view and call the ajax from
the view with the argument. If we need to call the LOAD from the view, its
{{=LOAD('default','manage_things',ajax=True)}}
Then it fails for m_count.
I mean passing args/vars in main_page():
def main_page():
main_pg=DIV()
m_cont = LOAD(f='*modal_content**.load*', *args=[ ],
vars={ }*, ajax=True, ajax_trap=True )
...
But may be you want to pass something from client side, i.e. args are
defined by some user action.
What I have done with your code is change the contoller to be:
def main_page():
main_pg=DIV('hello world')
m_cont = LOAD(f='modal_content.load', ajax=True, ajax_trap=True )
dialog = modal_wrapper(m_cont, _id='cont_id', header='Header',
footer='footer')
#show_modal_btn =
it's easy:
1. Place modal_wrapper() function in your_web2py_app/modUles named
'my_util.py' (just for example) - you have to import html-helpers in it:
from gluon.html import *
2. In view place:
...
{{=BUTTON( 'Apply',_type="button",_class = "btn
You got it to work? Because I get this:
default/main_page.html", line 83, in
NameError: name 'modal_wrapper' is not defined
*Controller is now:*
def main_page():
main_pg=DIV('hello world')
#m_cont = LOAD(f='modal_content.load', ajax=True, ajax_trap=True )
#dialog =
Look at that!
request.args(0)
'1'
Thank you Val. This is great.
On Friday, February 12, 2016 at 4:25:18 PM UTC-5, billmac...@gmail.com
wrote:
>
> My bad. I forgot the my_util.py
>
> On Friday, February 12, 2016 at 4:10:00 PM UTC-5, Val K wrote:
>>
>> it's easy:
>> 1. Place modal_wrapper()
OK, but what do you mean under "pass that argument from my view" ?
view is processed and rendered to html page at server side, JS runs
only on the client side.
so, if you can pass arg from veiw (i.e. arg is defined on server side),
also you can pass it in main_page():
def main_page():
I got to tell you...this is way more fun than Django. In django all I am
worried using that is the framework and url redirect. Here, the least
thing to worry about is framework and I can focus more on the development
and logic! Add such a helpful community. Thank you for all your help!
On
What I mean by passing argument from the view to the controller is this
(let us consider in my view):
(1) Apply
(2) Apply
In the above (1) is calling that URL with an argument id. (2) is a button,
when I click on that, it goes to the controller function my_controler_def,
and in
On Friday, February 12, 2016 at 12:04:08 PM UTC-8, billmac...@gmail.com
wrote:
>
> Works fine. Because I see the button and I click and see the pop up.
> Great. Only issue is, I need to update the table with my argument. For
> example:
>
> [...]
>
> So, I need to pass that argument from my view
My bad. I forgot the my_util.py
On Friday, February 12, 2016 at 4:10:00 PM UTC-5, Val K wrote:
>
> it's easy:
> 1. Place modal_wrapper() function in your_web2py_app/modUles named
> 'my_util.py' (just for example) - you have to import html-helpers in it:
>
> from gluon.html import *
>
> 2.
y", line 12, in modal_wrapper
close_cross = BUTTON(SPAN(XML(''),
**{'_aria-hidden':"true"}),_type="button",
_class="close",data={'dismiss':"modal"},**{'_aria-label':"Close"})
NameError: global name 'BUTTON' is not defined
How do I get the BUTTON to work in my_util?
O n Friday,
LOAD() works like URL(), so, to pass args/vars to modal_content you could
write
m_cont = LOAD(f='*modal_content**.load*', *args=[ ], vars={ }*,
ajax=True, ajax_trap=True ) # see LOAD in web2py book
in modal_content controller there is nothing new, everything is as usual
def
Hi!
Here is my solution. I have modal_wrapper function. In controller file, I
have two controllers - main_page and modal_content:
def main_page():
main_pg=DIV()
m_cont = LOAD(f='*modal_content**.load*', ajax=True, ajax_trap=True )
dialog = modal_wrapper(m_cont,
Thank you! Works great.
On Thursday, February 11, 2016 at 4:27:22 PM UTC-5, Val K wrote:
>
> Hi!
> Here is my solution. I have modal_wrapper function. In controller file, I
> have two controllers - main_page and modal_content:
>
>
>
> def *main_page*():
>
> main_pg=DIV()
>
>
Thank you for your answer Massimo. When I implemented this.
Apply To This Post
It shows me a button and then I get redirected to another page. I just
wanted a pop up window open up with a form to submit that user can move
around without being redirected to another page.
On Wednesday,
Bootstrap3 has built-int
modals: https://nakupanda.github.io/bootstrap3-dialog/
You can but {{=form}} in the body of the modal.
On Tuesday, 9 February 2016 14:26:05 UTC-6, billmackalis...@gmail.com wrote:
>
> Hello, A new user migrating from Django to web2py and absolutely loving
> it. A quick
I see you want a different window, not a modal.
then you have to put the form logic in its own controller action and call
it from js
click me
On Wednesday, 10 February 2016 18:00:44 UTC-6, billmackalis...@gmail.com
wrote:
>
> Thank you for the answer Massimo. I did this like you said to put
Thank you for the answer Massimo. I did this like you said to put the form
in the body in index/popup.html however, it didn't pop up like the example
in the link above. Instead I got it in the same browser. I am guessing my
implementation is wrong.
×
Modal title
20 matches
Mail list logo