There are some design issues here. The main think is that you click on the
button you want something to happen without the reloading the page. Yet you
make the callback=URL() point to the same action that generates the
page while it should point to a separate action which just performs the
I tried doing this but absolutely nothing happens when I click the button
On Tuesday, December 18, 2012 5:10:01 PM UTC, Massimo Di Pierro wrote:
>
> BTW...
>
> def edit_record():
> ...
> if request.vars.deltutorlink:
> response.flash = T('deltutorlink reached!')
> ...
>
> If ed
Sure thing Massimo,
here's my view: http://bpaste.net/show/nSrzmYsurH2CnXLrpdwJ/
here's my controller: http://bpaste.net/show/KEx38v6ARYgsUwG8oXMd/
Daniele
On Tue, Dec 18, 2012 at 5:07 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:
> Please post your code so we can try it.
>
> Are
BTW...
def edit_record():
...
if request.vars.deltutorlink:
response.flash = T('deltutorlink reached!')
...
If edit_record is called via ajax and not within a component,
than response.flash is not displayed because there is no view associated to
the callback. You can do:
de
Please post your code so we can try it.
Are you sure the edit_profile is not being called? Can you use the JS
console in chorme to see what is going on?
Massimo
On Tuesday, 18 December 2012 10:49:28 UTC-6, Daniele wrote:
>
> Still isn't working for me :'(
>
> In my view, I have:
> {{=A('Delete
Still isn't working for me :'(
In my view, I have:
{{=A('Delete Role',_class="btn
btn-danger",_id='deltutorlink',
callback=URL('edit_profile'),delete='#deltutor')}
in my controller, under the edit_profile method, I have:
if request.vars.deltutorlink:
response.flash = T('deltutorlink re
{{=A('delete
123',callback=URL('delete',args=123),delete='#row123')}} ...
The delete argument indicates that upon success you want to remove the ... from the page. If there is a "delete" argument the
confirmation popup is automatic. ;-)
On Saturday, 15 December 2012 11:35:28 UTC-6, Danie
I want to do something very simple but it's taking me eons to do this~
When the button is clicked, I want a javascript alert to pop up that asks,
are you sure? Yes/No.
If Yes, then run this code: auth.del_membership('role')
No redirection, just delete the role.
That's all -_- this is taking me w
None. You are asking to ":eval" the result. It meas the action is supposed
to return JS
def test():
return "alert('hello')"
anyway, you should debug this with the JS console in chrome. We do not
know exactly how your code looks like.
On Saturday, 15 December 2012 09:08:37 UTC-6, Daniele wr
I am trying with:
{{=A('Delete Role', _class="btn btn-danger", _id="del_role_tutor",
callback=URL('test'), target=":eval")}}
and in my controller:
def test():
return "Hello"
or
def test():
return dict()
but nothing happens. Why is this??
On Monday, December 10, 2012 9:15:30 PM UTC,
Please pardon my ignorance, I didn't know there was a button helper.
And thanks Massimo, I'll give the A with the class btn a try now!
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
>
> When I use form.add_button() I am able to add a button to a form, which I
> can display with {{=f
As NIphlod says there is a BUTTON helper. Yet instead of
Delete Role
I would do:
{{=A('Delete Role', _id="b_normal", _class="btn btn-danger",
callback=URL('test'), target=':eval')}}
which will look the same. Why use BUTTON when you can use A with class
"btn" and works the same?
On S
Don't take it in the wrong way, I'll start with a little introduction:
web2py is a framework that can do a lot of stuff. When it generates an HTML
page the way you told him so, it returns it to the browser. From then on,
it's just how HTML works: any button (without javascript intercepting the
I tried putting this HTML
Delete Role
which I saw on a stackoverflow post. However, even when I do that and click
the button, the form ALWAYS gets submitted. I already have a submit button
so I don't understand why the form is being submitted via other buttons as
well. Does anyone know why this
It's quite pathetic that web2py doesn't provide a BUTTON helper by the
way...
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
>
> When I use form.add_button() I am able to add a button to a form, which I
> can display with {{=form}} in my view.
>
> However, if I'm making a custom for
So it's not possible to do this with a button?
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
>
> When I use form.add_button() I am able to add a button to a form, which I
> can display with {{=form}} in my view.
>
> However, if I'm making a custom form using form.custom, how can I d
onclick accepts a bit of javascript, not an url
On Friday, December 14, 2012 1:16:22 PM UTC+1, Daniele wrote:
>
> I'm also trying this but it doesn't work:
>
> Delete Role
>
> Another thing I noticed is that whatever I put in onclick, it keeps trying
> to submit the form. I don't want to subm
I'm also trying this but it doesn't work:
Delete Role
On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote:
>
> When I use form.add_button() I am able to add a button to a form, which I
> can display with {{=form}} in my view.
>
> However, if I'm making a custom form using form.custom, h
I have the button
http://127.0.0.1:8000/examples/global/vars/URL>(del_role)}}" class="btn
btn-danger">Delete Role
And in my controller I try to put def del_role and, if the user has
membership, i want to del_membership for that role. But this doesn't seem
to be working. You were telling me t
{{=A('click me',_href=URL('action'))}} (redirects)
or
{{=A('click me', callback=URL('action'))}} (call via ajax)
or
{{=A('click me', callback=URL('action'),target="t")}}
(call via ajax and store result in t)
or
{{=A('click me', callback=URL('action'),delete="div#c")}}
(call via ajax and d
Ok. What's the correct way of associating an action to the HTML button with
web2py?
On Tuesday, December 11, 2012 12:30:34 AM UTC, Massimo Di Pierro wrote:
>
> This is not worth it. If you make a custom form than you are using html,
> you may as well make the button in html.
>
> On Monday, 10 De
This is not worth it. If you make a custom form than you are using html,
you may as well make the button in html.
On Monday, 10 December 2012 15:15:30 UTC-6, Daniele wrote:
>
> When I use form.add_button() I am able to add a button to a form, which I
> can display with {{=form}} in my view.
>
>
22 matches
Mail list logo