Re: [web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread Jonathan Lundell
On Dec 4, 2010, at 2:26 PM, mr.freeze wrote:
 
 Yep, changed on 11/3. Maybe web2py_ajax.html doesn't fall under the
 same backwards compatibility umbrella as the actual framework. Anyway,
 it's selecting by name so just change your onclick to:
 _onclick=ajax('process_checkbox',['junk'],':eval');)
 ...and it should work.

In general, the stuff under applications/ doesn't fall under backwards 
compatibility, since it won't change once you've incorporated it into your own 
app, unless and until you want to change it, either by doing your own edits or 
by incorporating a later version. 

Re: [web2py] Re: Checkbox ajax not updating request.vars -- bug or pilot error?

2010-12-04 Thread Jonathan Lundell
On Dec 4, 2010, at 2:53 PM, weheh wrote:
 
 OK, that did the trick. Thanks.
 
 As for the web2py_ajax.html file, all I have to say is, 'Urggh!' This
 is probably the 3rd time I've been bitten by changes to the file in
 the last year or two. Must keep that in mind in the future.

Right; you can't count on being able to simply copy it over to your application 
when it changes.

I've been doing this (a little tedious, but necessary). I make a copy of the 
stock web2py_ajax.html file (this could happen with other application files as 
well; layout.html in my case) to keep as a reference, and then make my own 
local changes to it (typically not a lot, but some).

When I'm motivated to incorporate a newer version, I diff the original stock 
file against the new one, to see what the web2py changes are, and diff the 
original stock file against my current file, to see what I did. Then I apply my 
changes to the new stock version (keeping a reference copy, of course), and 
also evaluate whether the changes to the web2py version have any implications 
for my app, and deal with them.

I could probably enlist hg to help with this process, but so far I've been 
doing it manually; I find it a little less confusing. You're basically merging 
two parallel branches, and sometimes it's hard to do that mechanically.

 
 Again, many thanks for the help, Nathan. You too, Jonathan.
 
 
 On Dec 4, 5:26 pm, mr.freeze nat...@freezable.com wrote:
 Yep, changed on 11/3. Maybe web2py_ajax.html doesn't fall under the
 same backwards compatibility umbrella as the actual framework. Anyway,
 it's selecting by name so just change your onclick to:
  _onclick=ajax('process_checkbox',['junk'],':eval');)
 ...and it should work.
 
 On Dec 4, 4:17 pm, mr.freeze nat...@freezable.com wrote:
 
 Perhaps this was a recent change in trunk but it's definitely not
 backwards compatible.  Selecting by name and id will definitely give
 you different results.
 
 On Dec 4, 4:14 pm, mr.freeze nat...@freezable.com wrote:
 
 Your web2py_ajax.html ajax function IS different. Note this line:
 Yours:
  q = jQuery([name=+s[i]+]).serialize();
 Standard:
  q = jQuery(#+s[i]).serialize();
 
 On Dec 4, 3:32 pm, weheh richard_gor...@verizon.net wrote:
 
 On close inspection, web2py_ajax.html is out of date on my test app. I
 updated web2py_ajax.html and the test case still doesn't work.