[web2py] Re: Trouble with components

2011-08-05 Thread Gour-Gadadhara Dasa
On Fri, 5 Aug 2011 08:24:54 -0700 (PDT) G wrote: > As it is, the web2py book seems to assume a lot of familiarity with creating > web applications and less familiarity with Python. I imagine several people > like me are in the opposite situation. At the moment I'm on the verge of learning bout b

[web2py] Re: Trouble with components

2011-08-05 Thread G
Having many small forms is actually working out pretty well, and seems to be a resonable solution. It was not intuitive to me, but I think it's just a disconnect between the way I would do things in a GUI framework versus the way things need to be done for web applications. By the way, I think it w

[web2py] Re: Trouble with components

2011-08-05 Thread Massimo Di Pierro
I know. They were just regular good practice suggestions. Sorry. Will look for a solution. On Aug 4, 6:44 pm, G wrote: > Hi Massimo, > Thank you for the suggestions. I have implemented both, but neither > helps with the original problem of having components with multiple > buttons work with ajax=

[web2py] Re: Trouble with components

2011-08-04 Thread G
Hi Massimo, Thank you for the suggestions. I have implemented both, but neither helps with the original problem of having components with multiple buttons work with ajax=True. My new controller generates several forms each with just one button and with distinct formnames. It has an if form.accepts

[web2py] Re: Trouble with components

2011-08-04 Thread Massimo Di Pierro
if you do not need a view and your component only displays the form you can just "return form" and pypass the generic view. It will be faster. I also suggest you use ajax=True. Always call the component directly as a test that it is working. On Aug 4, 6:33 pm, G wrote: > I think I found a workabl

[web2py] Re: Trouble with components

2011-08-04 Thread G
I think I found a workable (but slightly annoying) solution: create several mini-forms that only have the submit button, each with a different form name. Then I can just use many if form_blah.accepts(request.vars, session, formname='form_blah'): clauses. I'd still be interested in knowing if there

[web2py] Re: Trouble with components

2011-08-04 Thread pbreit
Coupla other approaches: http://www.johnnycode.com/blog/2010/04/08/jquery-form-serialize-doesnt-post-submit-and-button-values-duh/ http://stackoverflow.com/questions/4007942/jquery-serializearray-doesnt-include-the-submit-button-that-was-clicked I'm surprised Jquery doesn't provide better support

[web2py] Re: Trouble with components

2011-08-03 Thread G
Hmm, so it sounds like components with multiple buttons are basically not supported easily. I am writing an application to control a bunch of scientific equipment. For each piece of equipment I was planning to make one component to monitor and control it, and then put all these components on one we

[web2py] Re: Trouble with components

2011-08-03 Thread Anthony
Forms in ajax components and non-ajax components with ajax_trap=True are submitted via ajax, and the form variables are serialized via the jQuery .serialize() method. As explained here (http://api.jquery.com/serialize/), the .serialize() method doesn't know what triggered the form submission, so

[web2py] Re: Trouble with components

2011-08-03 Thread G
I just tried a single component with ajax=True and found that it was not responding. Digging more deeply, I am finding that request.vars includes only _formname="default" and _formkey=. Only with a single form and ajax=False do I see the expected autoEQ = "yes". Any idea what's going on? Thanks, G

[web2py] Re: Trouble with components

2011-08-03 Thread pbreit
I think with ajax=False you're going to run into problems because the end result is both of the forms on one page of HTML and the controller might get confused on which to handle. But I would think ajax=True should work. ajax_trap should be unnecessary. Can you get one form to work by itself wi