[web2py] Re: Ajax Pass ID to Controller Function

2019-09-24 Thread Paco Bernal
Hi ajax('{{=URL('Tools', 'userdelete')}}/'+iduser , [], ''); > Regards -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message becaus

Re: [web2py] Re: ajax controller loses formatting?

2019-01-02 Thread Eliezer (Vlad) Tseytkin
Got it, I knew I missed something basic :) Thank you!! On Wed, Jan 2, 2019, 7:22 PM Anthony In order for an associated view to be executed, you must return a > dictionary. If you return a string or HTML helper, it will be returned > directly to the browser with no view being executed. > > Anthon

[web2py] Re: ajax controller loses formatting?

2019-01-02 Thread Anthony
In order for an associated view to be executed, you must return a dictionary. If you return a string or HTML helper, it will be returned directly to the browser with no view being executed. Anthony On Wednesday, January 2, 2019 at 3:14:50 PM UTC-5, Vlad wrote: > > I am sure I am missing somethi

[web2py] Re: ajax call from Select sends ["345","346"] instead of ["346"]

2017-09-26 Thread Dave S
On Tuesday, September 26, 2017 at 9:07:28 AM UTC-7, Ramos wrote: > > Hello i found a strange thing. > The first select calls the endpoint correctly with "2800" or "EMP1" in > postvars > Silly question: are these selects enclosed in a form? Is it the same form for both, separate instances of

[web2py] Re: ajax call from Select sends ["345","346"] instead of ["346"]

2017-09-26 Thread António Ramos
i meant "2800" or "2795" in the first select 2017-09-26 17:06 GMT+01:00 António Ramos : > Hello i found a strange thing. > The first select calls the endpoint correctly with "2800" or "EMP1" in > postvars > > onchange="ajax('/fileit/entities/insert_or_update_ > extra_field?extrafield=13&relatedt

Re: [web2py] Re: Ajax upload, working in localhost (rocket), but not working in prodution (nginx)

2017-07-16 Thread Junior Phanter
I'm returning for feedback. I changed the controller, so I will not be using generic pattern, correct? Another problem solved was that the pillow, strangely, was not processing the sent image. I uninstalled and reinstalled again so far everything is fine. Here's the change (red): Thanks Leonel Câm

[web2py] Re: Ajax upload, working in localhost (rocket), but not working in prodution (nginx)

2017-07-16 Thread Anthony
On Sunday, July 16, 2017 at 7:20:33 AM UTC-4, Leonel Câmara wrote: > You are using the generic json view. By default generic views are only > allowed on localhost. You need to allow it for your function by adding > something like this to your models. > > > response.generic_patterns = ['default/

[web2py] Re: Ajax upload, working in localhost (rocket), but not working in prodution (nginx)

2017-07-16 Thread Leonel Câmara
You are using the generic json view. By default generic views are only allowed on localhost. You need to allow it for your function by adding something like this to your models. response.generic_patterns = ['default/echo_upload.json'] -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: ajax and 403 forbidden issue..

2017-01-11 Thread António Ramos
The web2py ajax does not have the ".then" method or errror:function... like the regular $.ajax Do i have to use $.ajax instead? Seems that the error function is missing from web2py ajax. Why is it not implemented ? Regards António 2017-01-11 15:21 GMT+00:00 António Ramos : > Hello i use the web

[web2py] Re: ajax return multiple javascript one at a time

2016-06-07 Thread Anthony
Note that there is no guarantee that the server will execute and return those Ajax requests in order. Also, if you want them to be processed in parallel on the server and you don't need the session for these calls, you should call session.forget(response) at the beginning of each call, as that

[web2py] Re: ajax return multiple javascript one at a time

2016-06-07 Thread Paolo Amboni
Ok, debugged in the js console. They do fire up, but thanks to your suggestion i did find that the problem was in the response from the web2py function. Now all works fine. If only we could use python instead of javascrit... :-) Il giorno domenica 5 giugno 2016 14:38:57 UTC+2, Anthony ha s

[web2py] Re: Ajax load function div with incorrect data and duplicates elements of the page

2016-06-06 Thread isi_jca
Hi!!! I commented that you can solve the problem by doing the following: 1°) Modifying the function as follows def fgetlocalidad(): idprovincia = 0 result='' idprovincia = int(request.vars.idprovincia) localidad_rows = db(db.trlocalidad.idprovincia==idprovincia).select(orderby=d

[web2py] Re: ajax return multiple javascript one at a time

2016-06-05 Thread Anthony
What do you see in the browser network panel (are both requests firing, and if so, what are the responses?) and JS console (any errors reported)? On Sunday, June 5, 2016 at 7:26:57 AM UTC-4, Paolo Amboni wrote: > > I don't know if it is possible but: > > I need to query 4 different db with a sing

[web2py] Re: Ajax Form Update (and thank you for all the help)

2016-04-27 Thread Mark Billion
The problem is that Im at a loss. Right now, the process function calls next and sends to the default page. ajax_form = SQLFORM(db[field_array[3]], this_page_ajax, deletable=True).process(next = URL('default', field_array[4], vars=dict(cli=field_array[0]))) And Ive got it set up to deal with

[web2py] Re: Ajax Form Update (and thank you for all the help)

2016-04-25 Thread Massimo Di Pierro
Can you show up some more code. On Monday, 25 April 2016 08:51:14 UTC-5, Mark Billion wrote: > > I have a form that is accessed through ajax and displayed in a > modalRight now, on success, the modal clears and the parent page is > reloaded, which then shows the data that was entered in the

[web2py] Re: ajax callback onchange for checkbox boolean

2016-02-07 Thread 黄祥
found the solution with redirect(current.request.env.http_web2py_component_location, client_side = True), never thought that more than one check box must reload the whole page to ensure the value is store in the session, it's so different with the form field text input type, doesn't matter how

[web2py] Re: ajax callback onchange for checkbox boolean

2016-02-06 Thread 黄祥
why when using 2 checkbox, the latest change or click is applied, the previous one is ignore to store in the session value? let say, i have two unchecked checkbox name : bevel and gosok_halus, when i click for all checkbox, first : bevel and then second click : gosok_halus, the value that been

[web2py] Re: ajax need to return 4 values

2015-11-15 Thread lucas
ok, i went with qQuery.getJSON. here is how i did it and it works great. JSON trading is cool. just for sharing: under the default controller's function, i have a section where i implement the javascript/jQuery code via an onchange of a select input. the select input is meant to prepopulate

[web2py] Re: ajax need to return 4 values

2015-11-14 Thread Anthony
The third argument to ajax() can be the id of a target element, but it can also be ":eval" or a Javascript function. If you use ":eval", you can return any Javascript code, and it will be eval'ed -- so just generate the code necessary to update the four inputs (e.g., "$('#input1').val(value1);

[web2py] Re: ajax need to return 4 values

2015-11-14 Thread Paolo Valleri
There isn't a solution out-of-the-box in web2py. I'd suggest returning a json with the 4 values, and then apply the result to the input fields Paolo On Saturday, November 14, 2015 at 1:50:56 PM UTC+1, lucas wrote: > > hello one and all, > > how do i run an ajax function under an onchange of a se

[web2py] Re: ajax todo lists

2015-09-29 Thread Dave S
On Tuesday, September 29, 2015 at 8:36:07 AM UTC-7, Mark Billion wrote: > > Does anyone have a good example out there in W2Pland? Im looking > What makes a good example of a todo list? I can see using the wiki example, if you don't care about prioritization or statistics, but for one line

[web2py] Re: Ajax callback with current select value

2015-08-17 Thread Gael Princivalle
Thank's a lot Val. Debugging is a pain. I use just '[name]' and now it works because... I've take off {{=BEAUTIFY(response._vars)}} from the view, that seems to have problems with ajax calls. Il giorno martedì 18 agosto 2015 07:07:02 UTC+2, Val K ha scritto: > > Hi, Gael! I think in ajax call mu

[web2py] Re: Ajax callback with current select value

2015-08-17 Thread Val K
Hi, Gael! I think in ajax call must be "[name='my_select']" or just '[name]' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message be

[web2py] Re: Ajax callback with current select value

2015-08-17 Thread Gael Princivalle
Thank you Val. Ok now with in the select name='my_select' and in the Ajax call ['my_select'] I can get the current value of my_select in the controller with request.vars['my_select'] I can return it: def get_options_for_dropdown2(): id = request.vars['my_select'] return id So in the pag

[web2py] Re: Ajax callback with current select value

2015-08-14 Thread Derek
That explains why I had to stuff it into a hidden variable or input... cool! On Wednesday, August 12, 2015 at 10:35:47 AM UTC-7, Val K wrote: > > Yes! Of course! Because there is a small bug in web2py.js in ajax() (or > in the manual) : > If middle arg ( '[ ]' ) is string, it's treated as

[web2py] Re: Ajax callback with current select value

2015-08-12 Thread Val K
Yes! Of course! Because there is a small bug in web2py.js in ajax() (or in the manual) : If middle arg ( '[ ]' ) is string, it's treated as JQuery selector without any processing! So ajax() call must be like: ajax('{{=URL('default','get_options_for_dropdown2')}}', '[name="sel_1"], [name

[web2py] Re: Ajax callback with current select value

2015-08-12 Thread Gael Princivalle
Thanks a lot Val that's certainly the solution, however in the controller the var is always empty. This is the original select code: If I set manually the var in get_options_for_overrides the ajax call works. For debug, if I modify get_options_for_overrides for returning get_options_for_overrid

[web2py] Re: Ajax callback with current select value

2015-08-11 Thread Val K
Hello. Keep in mind that ajax() - is a simple web2py function which is based on Jquery (see web2py.js , its code is very short and clear) It can pass to controller the values of the input elements only, see http://api.jquery.com/serialize/. So your select controls must have a name - To

[web2py] Re: Ajax callback with current select value

2015-08-11 Thread Derek
The only way I found to do it was to set a hidden variable on change of the dropdown. On Tuesday, August 11, 2015 at 8:43:59 AM UTC-7, Gael Princivalle wrote: > > Hello. > > I'm still making a form like in this post: > > https://groups.google.com/forum/#!searchin/web2py/jquery$20db/web2py/tvfncY

[web2py] Re: ajax error

2015-07-28 Thread ermolaev . icreator
error resolved -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" g

[web2py] Re: ajax error

2015-07-28 Thread ermolaev . icreator
{{for r in pays_unconf:}} {{if type(r) != type([]):}} {{=r}} {{continue}} {{pass}} {{print 'dfdfg'}} {{pass}} {{continue}} not work in {{for - pass}} ?? -- Resources: - http:

[web2py] Re: ajax error

2015-07-28 Thread ermolaev . icreator
full code {{odd = None}} {{for r in pays_unconf:}} {{='{:%Y-%m-%d %H:%M:%S}'.format(r[6])}} {{=r[1]}} {{=IMG(_src=URL('static','images/currs/' + r[0].abbrev + '.png'), _width=30)}}

[web2py] Re: ajax error

2015-07-28 Thread ermolaev . icreator
in error details odd = None response.write('\r\n', escape=False) for r in pays_unconf: response.write("\r\n\r\n\r\n ", escape=False) response.write('{:%Y-%m-%d %H:%M:%S}'.format(r[6])) <- this line 53 !! response

[web2py] Re: ajax error

2015-07-27 Thread Anthony
In list.html, what code is in place of the ".."? What is in pays_unconf? You might need to see whether something is different about pays_unconf on the requests that result in the error. Anthony On Monday, July 27, 2015 at 4:32:50 PM UTC-4, ermolaev.icrea...@gmail.com wrote: > > I need - on

[web2py] Re: ajax error

2015-07-27 Thread ermolaev . icreator
I need - on click tag A or on ENTER in any input of form - - call an ajax function in index.html view: {{=A(TAG.i(_class='fa fa-search', _style='width:100px;'), _id = 'go', _onclick='ajax("'+URL('where'

[web2py] Re: ajax error

2015-07-27 Thread Anthony
I think we need to see more of the surrounding context in the view. The error appears to be related to string formatting, and somehow it is treating that entire line (including the template delimiters) as Python code. Anthony On Monday, July 27, 2015 at 1:14:08 PM UTC-4, ermolaev.icrea...@gmai

[web2py] Re: AJAX on click not restore button

2015-07-19 Thread Anthony
Looks like you have specified a relative URL in the ajax() function, which simply gets appended to the URL of the current page, so instead of making the Ajax request to /default/aj1, the request is going to /default/index/aj1. You should use the URL helper instead: ajax('{{=URL('default', 'aj1'

[web2py] Re: Ajax and table with queried values

2015-06-25 Thread Carla Raquel
Since I have the values stored inside tables in a db, I am doing the queries I need and calculating values in the appropriate controllers and I am showing these values in the view like this: total_cost["_extra"]["SUM(Call.Cost)"] Otherwise, how can I do it in javascript on the client side? qui

[web2py] Re: Ajax and table with queried values

2015-06-25 Thread Leonel Câmara
You can also just use regular jquery ajax call instead of web2py's ajax and put the new row on the table with jquery. Something like: $.get( "{{=URL('default','calculate_cost')}}", $('#myForm').serialize(), function(newrow) { $('#my_table tbody').append(newrow); } );

[web2py] Re: Ajax and table with queried values

2015-06-25 Thread Carla Raquel
I've read through the chapter and the web2py appliances but I'm failing to comprehend.Currently, I have managed to add the code below on the javascript section, and the div with an id of 'here' is where's the bootstrap panel.In the controller I have a calculate_cost function that returns somet

[web2py] Re: Ajax and table with queried values

2015-06-24 Thread Dave S
On Wednesday, June 24, 2015 at 4:16:01 AM UTC-7, 黄祥 wrote: > > please see the book : > > http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#The-ajax-function > or web2py appliances (posonlinestore and estore) for example > http://www.web2py.com/appliances > > Note that the technique in

[web2py] Re: Ajax and table with queried values

2015-06-24 Thread 黄祥
please see the book : http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#The-ajax-function or web2py appliances (posonlinestore and estore) for example http://www.web2py.com/appliances best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - ht

[web2py] Re: ajax callback update css value

2015-05-23 Thread Dmitry Ermolaev
If you return JQuery script - not need to use any view template DIV( ... _onclick = "ajax(%s, [name1, name2, ...], ':eval');" % URL(controller, 'calback_0') def callback_0(): return '$(...)' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py

[web2py] Re: ajax callback update css value

2015-05-21 Thread 黄祥
for anthony's post, i think you can see it in the web2py google groups. he explain detail about this. for your another question, this is my full code of the cutted code above that work. *modules/transaction.py* def callback_0(session_order): id = int(current.request.vars.id) if current.request.va

[web2py] Re: ajax callback update css value

2015-05-21 Thread Dave S
On Thursday, May 21, 2015 at 4:06:07 PM UTC-7, 黄祥 wrote: > > I don't understand why you have the same calculation in your controller >> and your view, >> > > not sure what do you mean about calculation, i think is about variable > definition (status and value) i define it on controllers and vi

[web2py] Re: ajax callback update css value

2015-05-21 Thread 黄祥
> > I don't understand why you have the same calculation in your controller > and your view, > not sure what do you mean about calculation, i think is about variable definition (status and value) i define it on controllers and views e.g. 1. if i'm not define the variable status and value in vi

[web2py] Re: ajax callback update css value

2015-05-21 Thread Dave S
On Wednesday, May 20, 2015 at 10:41:16 PM UTC-7, 黄祥 wrote: > > hi, > > is it possible to have ajax callback return that update css value? > e.g. > *controller* > def callback_2(session_order): > """ cutted """ > if int(total_debit) == int(total_credit): > status = 'Balance' > value = 'text-succes

[web2py] Re: ajax callback update css value

2015-05-21 Thread 黄祥
that's do the trick, thank you so much anthony for your help. e.g. *controllers* return "jQuery('#status').html('%s'); jQuery('#status').removeClass().addClass('%s');" % (status, value) *views* {{if total_debit == total_credit:}} {{status = "Balance" }} {{value = "text-success" }} {{=SPAN(status,

[web2py] Re: ajax callback update css value

2015-05-21 Thread Anthony
I think there are two problems. First, the class of an element is not a CSS property, so you probably have to use removeClass and addClass. Second, you have attempted to pass the Python "value" variable directly into the Javascript code rather than use string formatting as you (properly) did wi

[web2py] Re: ajax callback can not return string type data

2015-05-16 Thread 黄祥
thank you so much for correct me, anthony. it works now. best regards, stifan On Saturday, May 16, 2015 at 8:31:56 AM UTC+7, Anthony wrote: > > Your Javascript syntax is incorrect -- the text inside .html() must be > wrapped in quotes: > > "jQuery('#status').html('%s');" % (str(status)) > > Anth

[web2py] Re: ajax callback can not return string type data

2015-05-15 Thread Anthony
Your Javascript syntax is incorrect -- the text inside .html() must be wrapped in quotes: "jQuery('#status').html('%s');" % (str(status)) Anthony On Friday, May 15, 2015 at 9:13:21 PM UTC-4, 黄祥 wrote: > > hi, > > is it possible to have ajax callback return string type data? > e.g. > controllers

[web2py] Re: AJAX div reload indicator

2015-04-27 Thread Dave S
On Saturday, April 25, 2015 at 8:28:15 AM UTC-7, Gary Cowell wrote: > > I found that I can use: > > {{=LOAD('tenant','stackList.load',ajax=True, target="stackList",vars={ > 'reload_div':'stackList'},content=CENTER(IMG(_src=URL(request.application, > 'static','images/ajax_loader_blue_256.gif'}

[web2py] Re: AJAX div reload indicator

2015-04-25 Thread Gary Cowell
I found that I can use: {{=LOAD('tenant','stackList.load',ajax=True, target="stackList",vars={ 'reload_div':'stackList'},content=CENTER(IMG(_src=URL(request.application, 'static','images/ajax_loader_blue_256.gif'}} So this gives me a spinner gif inside my component div on page reload. It doe

[web2py] Re: AJAX div reload indicator

2015-04-25 Thread Gary Cowell
I think I found my solution, in my controlling function when I send the response.js for the reload, I'm doing it like this now: spinner=CENTER(IMG(_src=URL(request.application,'static', 'images/ajax_loader_blue_256.gif'))) response.js = "jQuery('#stackList').html('{0}');jQuery('#

[web2py] Re: AJAX div reload indicator

2015-04-25 Thread Gary Cowell
I've tried twice before to post my solution on this, but here's a third try: So I solved this for my app, in the following way. For reference for others, and for comment if I'm doing something stupid. But, this works for me: In my view: {{=LOAD('tenant','stackList.load',ajax=True, target="stack

[web2py] Re: Ajax call issues.

2015-03-02 Thread Niphlod
you can't expect something in "..//static/python/the_mailer.py" to be magically executed just POSTing to that path... use a proper function in a proper controller... On Monday, March 2, 2015 at 7:24:30 AM UTC+1, John Costantino wrote: > > Hey so I have a mail script written in python which works

[web2py] Re: Ajax call does not redirect.

2015-01-21 Thread James O' Driscoll
Hey Leonel, I tried that, when I ran the code that you suggested, web2py did not redirect to display_canvas, Execution in the following order, with client_side=True: 1.run display_canvas 2.ajax call to display and with, with client_side=False: 1. run display_canvas 2. ajax call to

[web2py] Re: Ajax call does not redirect.

2015-01-18 Thread Leonel Câmara
Hey, For ajax calls you need to use: redirect(URL('default', 'display_canvas', args=[screen_width]), client_side=True) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (

[web2py] Re: Ajax/Updated Form Field

2014-12-30 Thread Mark Billion
I am wondering if I answered my own (incomprehensible) question: I plugged in Jeditable , which is great. Then I set the script up to post to a controller that inputs the data to the db (which validates, i.e., 'integer'), commits it, and then retur

[web2py] Re: ajax eval not working when url has an argument

2014-11-02 Thread Toby
Thanks Anthony, that works perfectly (minor typo: need an '=' in front of URL). Tobias -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received t

[web2py] Re: ajax eval not working when url has an argument

2014-11-02 Thread Anthony
Note, I just made an update to the book repo changing all ajax() examples to use the URL() function in order to avoid this confusion (previously, the first example had been changed but the others were left as is). Anthony On Sunday, November 2, 2014 9:54:42 AM UTC-5, Anthony wrote: > > > >>

[web2py] Re: ajax eval not working when url has an argument

2014-11-02 Thread Anthony
> > In the ajax call, 'echo' is a relative URL, so it will be appended to the URL of the current page. Instead, try using the URL() function: In general, when you have an Ajax problem, it usually helps to open the browser developer tools and watch the network activity and JS console. T

[web2py] Re: ajax eval not working when url has an argument

2014-11-02 Thread Toby
Hi Anthony, Thanks for responding. Here's my code. default.py: def one(): return dict() def echo(): return "jQuery('#target').html(%s);" % repr(request.vars.name) one.html: {{extend 'layout.html'}} Tobias -- Resources: - http://web2py.com - http://web2py.com/book (Documenta

[web2py] Re: ajax eval not working when url has an argument

2014-10-31 Thread Anthony
Should work. Please show your code. Anthony On Friday, October 31, 2014 12:30:17 PM UTC-4, Toby wrote: > > Hi, > > I tried this ajax eval example: > > http://www.web2py.com/books/default/chapter/29/11/jquery-and-ajax#Eval-target > > It works fine so long as the url doesn't have an argument. But i

[web2py] Re: ajax issue/question

2014-10-27 Thread Anthony
Instead of the iframe, why not just put the record in a div that gets updated via Ajax? On Monday, October 27, 2014 11:16:14 AM UTC-4, Craig Matthews wrote: > > I am looking to reduce the amount of data transferred by making this page > of my application behave like an SPA (single-page applicati

[web2py] Re: ajax issue/question

2014-10-27 Thread Leonel Câmara
You really don't need an iframe for any of this. If you really want to reduce the amount of data you should have your search form return the results using json and then make the HTML to put in the results using javascript. That said I don't know exactly what's going wrong. My guess is that you'

[web2py] Re: ajax issue/question

2014-10-27 Thread Craig Matthews
I am looking to reduce the amount of data transferred by making this page of my application behave like an SPA (single-page application). I have searching built into the master page, and then individual records are loaded into the iframe, one at a time. When a user wants another record, they ca

[web2py] Re: ajax issue/question

2014-10-27 Thread Leonel Câmara
Javascript code in the iframe shouldn't make changes in the top frame. It's possible if the iframe is in the same domain, my guess is that you aren't referring to the parent window so it's looking for the place to put the ajax call result inside the iframe, but you shouldn't. Why are you using

[web2py] Re: ajax login, wrong password redirects to wrong page

2014-09-01 Thread Maciej S
I have Python 2.7.5 W dniu sobota, 30 sierpnia 2014 01:32:45 UTC+2 użytkownik Massimo Di Pierro napisał: > > Please open a ticket. Which python version? > > On Thursday, 28 August 2014 08:19:42 UTC-5, Maciej S wrote: >> >> Some time ago I posted question on stackoverflow, and I still don't have

[web2py] Re: ajax login, wrong password redirects to wrong page

2014-09-01 Thread Maciej S
I've created new issue: https://code.google.com/p/web2py/issues/detail?id=1975&start=100 W dniu sobota, 30 sierpnia 2014 01:32:45 UTC+2 użytkownik Massimo Di Pierro napisał: > > Please open a ticket. Which python version? > > On Thursday, 28 August 2014 08:19:42 UTC-5, Maciej S wrote: >> >> Some

[web2py] Re: ajax login, wrong password redirects to wrong page

2014-08-29 Thread Massimo Di Pierro
Please open a ticket. Which python version? On Thursday, 28 August 2014 08:19:42 UTC-5, Maciej S wrote: > > Some time ago I posted question on stackoverflow, and I still don't have a > solution. I haven't found solution on the google mail list. > > Could someone help me: > > http://stackoverflow.

[web2py] Re: ajax posts text input twice when name and id are identical

2014-08-06 Thread Cliff Kachinske
I can do that. But I discovered it was doing something much more interesting than my original diagnosis. The inputs in question were editable and generated by the controller. As such they had an assigned value. When I ajaxed them to the server, apparently two copies of the input were sent. One

[web2py] Re: ajax posts text input twice when name and id are identical

2014-08-06 Thread Anthony
Can you show the relevant HTML? What does the post data look like? On Wednesday, August 6, 2014 5:48:33 PM UTC+2, Cliff Kachinske wrote: > > This is not supposed to happen and I don't know why it did. > > The js looks like this: > $('#products_on_order').on('click', '.edit_bound_container', func

[web2py] Re: ajax based cascading drop down menus not working in internet explorer

2014-06-18 Thread Sarbjit
Solved !! I have used second select inside and assigned id to it, it seems ajax callback was not able to replace in IE. OLD :- {{for maker in makers:}} {{=maker.Name}} {{pass}} NEW CODE :- {{for maker in makers:}} {{=maker.Name}} {{pass}} -- R

[web2py] Re: ajax based cascading drop down menus not working in internet explorer

2014-06-18 Thread Sarbjit
This problem can be reproduced by using this code in a new app created using web2py. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this me

[web2py] Re: Ajax LOAD

2014-05-20 Thread Niphlod
if the amount of data displayed fits on a page, it's too much hassle. Just code a component and refresh it every x seconds with the *timeout* and *times* parameter of the LOAD helper. On Tuesday, May 20, 2014 7:33:36 PM UTC+2, Jesse Ferguson wrote: > > I "Think" the way to go about this would be

[web2py] Re: Ajax LOAD

2014-05-20 Thread Jesse Ferguson
I "Think" the way to go about this would be to have the .load file a js script that gets the current list of items on the table, then compare that list to the one returned and remove the items if they are not in the list and then add the items that are in the list does that sound sane? --

[web2py] Re: Ajax LOAD

2014-05-20 Thread Jesse Ferguson
In the long run i would like to do something like http://blockchain.info/ 's main page and have a semi live feed of database items that are added and removed depending on what the controller returns -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/

[web2py] Re: AJAX component reload problem using .html vs .load

2014-02-28 Thread Dan M
I abridged the code to make it easier to diagnose. Yes, at the beginning of the controller a0=request.args(0). Sorry, the click handler is vestigial, as AJAX reload obviates the need for it. TIP_APP as well is just old and haven't cleaned that up. Thank you for pointing these out! Your resp

[web2py] Re: AJAX component reload problem using .html vs .load

2014-02-24 Thread Anthony
Is the below your exact code? I ask because in stats_del, you refer to a variable a0 that has not been defined (presumably it is request.args(0)). Also, your click handler refers to a ".del-div" class, but I don't see any elements with that class. Anyway, by default, if an incoming URL has no e

[web2py] Re: Ajax

2014-01-07 Thread Ruud Schroen
Have you found a solution for this yet? I'm struggling with this as well.. On Thursday, September 10, 2009 5:21:11 AM UTC+2, eddwinston wrote: > > Hi, > > I am trying to make an ajax login, I am currently sending request to > this url: [app]/default/user/login. But it has been fruitless. I just

[web2py] Re: Ajax function

2013-11-13 Thread Derek
You're using eval, but are you returning executable javascript from your function 'paginatore' ? On Tuesday, November 12, 2013 7:17:52 AM UTC-7, Luca Dalla Palma wrote: > > > Hello, > this is my *view* > > > on the *controller *I build a function containing the folowing code: > > pippone='ciao'

Re: [web2py] Re: Ajax input masks

2013-08-20 Thread Warren Block
Thank you, I see what you are saying and will test the jQuery examples. Ideally, I'd like to predefine the validation code and just specify a mask when the field is declared in the Field statement (DRY). Then forms would inherit the value and use the appropriate jQuery code for those fields.

[web2py] Re: Ajax input masks

2013-08-19 Thread Massimo Di Pierro
web2py does this automatically for some fields (integer, float, decimal). It prevents you from typing invalid chars and also validates serverside for security. It very easy to add other types of client-size typing restrictions by using the examples. For example for integer: jQuery(document).on(

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
yep, but that's not playing fair ^_^ happy that you resolved the problem though. On Friday, August 2, 2013 2:49:00 PM UTC+2, Marco Prosperi wrote: > > > > the solution (simple as a solution must be) is changing the > 'cart_callback' to update the entire (always little) . Sorry, you > haven't pa

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Marco Prosperi
the solution (simple as a solution must be) is changing the 'cart_callback' to update the entire (always little) . Sorry, you haven't passed the test :-P thank you for your time! Marco On Friday, August 2, 2013 10:22:23 AM UTC+2, Niphlod wrote: > > well, given that you're not an expert on ja

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
well, given that you're not an expert on javascript events (:-P) I'd use response.js in both the add and the sub functions to trigger the changes in your total field. This is one of the reasons that pushed me to create a new web2py.js (will be available from 2.6.0) , but you need to be comfortab

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Marco Prosperi
I've started from the PosOnLine demo appliance. There with the 'add' and 'sub' buttons you can change the quantity of the products you want to buy, but there is no total. I've tried to add a total in the view so that when the the customer 'adds' a product both the quantity and the total changes

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
uhm. the change event must be hooked to an input that changes, not to a piece of the page ... let me understand: you have a page with a total that needs to be refreshed via ajax after having submitted with ajax the "add" or the "sub" function ? On Friday, August 2, 2013 12:45:17 AM UTC+2, Marco

[web2py] Re: ajax() infinite loop

2013-08-01 Thread Marco Prosperi
It was the first thing I tried, using the same view and the following script, but nothing happens in this case when the quantity changes. Maybe it interferes with the 'add' and 'sub' callbacks? jQuery(document).ready(function(){ jQuery('.e').change(function(){ jQuery('#910').slideToggl

[web2py] Re: ajax() infinite loop

2013-08-01 Thread Niphlod
well, you are hooking up to the event that gets fired every time an ajax request completes. you "trial" code just replace the fragment with a fixed value, but if you use ajax instead the ajaxstop will fire in a loop, and it's correct that it does it. Why are you hooking up to the ajaxstop event

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-24 Thread lesssugar
OK, just for the record: The reason my code below was not working for update was wrong first argument of ajax() funcion. In my code the first argument - url - wad relative, while it *should* be absolute. So all I needed to do is change this: $('#select_1').change(function() { ajax('p

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-23 Thread Alan Etkin
> > Well, that's pretty impressive... mate. > > ;) > > Thanks a lot. Will surely try it. > I have updated the recipe because it had some details not solved (i.e. the forms do not process the input and widgets without filter with default values). Here's the new version. I plan to post this in we

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-23 Thread lesssugar
Well, that's pretty impressive... mate. ;) Thanks a lot. Will surely try it. On Sunday, June 23, 2013 7:53:29 PM UTC+2, Alan Etkin wrote: > > Ahoy there. I have just bought this recipe from a seafaring man with one > leg that might solve this matter. I hope you don't find it fishy: > > model >

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-23 Thread Alan Etkin
Ahoy there. I have just bought this recipe from a seafaring man with one leg that might solve this matter. I hope you don't find it fishy: model # Pretty close to your model aye? db.define_table("department", Field("name"), format="%(name)s") db.define_table("myrank", Field("name"), Field("depar

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-23 Thread Anthony
Sorry, I still don't see how your code achieves even the behavior you claim is working. For example, this: {{if request.vars.department:}} {{=XML(result)}} {{else:}} will only get executed when reloading the page after form submission, t

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-23 Thread lesssugar
Sure. The table I use *department* and *rank* in (and also the one I perform insert/update on): db.define_table('seafarer_experience', Field('user_id', db.auth_user, default=auth.user_id, readable=False, writable=False), Field('department', db.department, label='Department'), Field(

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-22 Thread Anthony
I think we also need to see the code that creates and processes the form. On Saturday, June 22, 2013 4:53:51 PM UTC-4, lesssugar wrote: > > Anthony, here's more info. > > In my form, you need to choose a department to generate respective list of > ranks. The tables involved: > > db.define_table('

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-22 Thread lesssugar
Anthony, here's more info. In my form, you need to choose a department to generate respective list of ranks. The tables involved: db.define_table('department', Field('name', length = 30), format=lambda r: r.name ) db.define_table('rank', Field('department_id', db.department), Field('name', leng

[web2py] Re: Ajax auto-populating doesn't work with update form

2013-06-22 Thread Anthony
Sorry, it wasn't clear that it was failing upon change of select_1. It might help to show more of the code that creates and displays the form, as it is not quite clear how everything is working. In particular, I don't quite get what that view code is doing and where it is used. Anthony On Satu

  1   2   3   4   5   >