[web2py] Re: Two problems with LOAD; one may be a bug(?)
On Wednesday, July 20, 2011 10:05:11 AM UTC-4, Iceberg wrote: > > Hi Anthony, > > I encounter same problem. STFW and I read your two posts. One is > above, the other is here: > > http://groups.google.com/group/web2py/msg/25bd655665bf47bf > > I am curious to see a bug exists for 2 weeks. That is not normal, > considering web2py has a tradition of fixing bug within 24 hours. Is > there anything special about this one? Thanks in advance. > > Regards, > Ray (a.k.a. Iceberg) I submitted a patch for a quick fix, but there are some conceptual problems with non-ajax components that need to be thought through, so I think Massimo may have postponed applying the patch until we figure that out. For example, the fix for this particular issue would involve copying response.generic_patterns to other_response.generic_patterns (which is the response object used by the component). But what if the parent page action made changes to response.generic_patterns -- should those changes propogate to the component (which is what would happen with the simple fix), or should the component not see those changes (that's a lot harder to work out without re-running the models)? Note, this issue is not limited to generic_patterns. Also, I think Massimo has just been very busy the past couple weeks, so there haven't been a lot of commits in general. Anthony
[web2py] Re: Two problems with LOAD; one may be a bug(?)
On Jul 13, 8:49 am, Anthony wrote: > > > Second problem: > > In trying to find out if setting ajax to True was causing my first > > problem, I stumbled over a second. Setting 'ajax=False' or not > > setting ajax at all causes an exception. Could this be a bug? If so, > > please let me know where and how to report the thing. It's totally > > reproducible on my system. > > There is currently a bug with ajax=False where response.generic_patterns is > not getting passed to the component, so generic views are not working with > non-ajax components at the moment. If you're getting an invalid view error, > that could be the problem. > > Anthony Hi Anthony, I encounter same problem. STFW and I read your two posts. One is above, the other is here: http://groups.google.com/group/web2py/msg/25bd655665bf47bf I am curious to see a bug exists for 2 weeks. That is not normal, considering web2py has a tradition of fixing bug within 24 hours. Is there anything special about this one? Thanks in advance. Regards, Ray (a.k.a. Iceberg)
[web2py] Re: Two problems with LOAD; one may be a bug(?)
Thank you. I'll clean up the repeated divs. On Jul 12, 8:49 pm, Anthony wrote: > On Tuesday, July 12, 2011 5:43:55 PM UTC-4, Cliff wrote: > > > Running Version 1.97.1 (2011-06-26 19:25:44) > > > First problem: > > This is a snippet from a view file. It works except that it displays > > the output of the quals function. Apparently it cannot find my > > quals.load file and is using the generic load file in its place. > > > > > {{=LOAD(c='users',f='quals.load', > > extension='load', args=(request.args(0)), > > ajax=True, target='tabs-3')}} > > > > Note, LOAD itself returns a div, and the id of that div is whatever you > specify as the 'target' argument (if you don't specify 'target', it creates > a random id). So, you're actually nesting the LOAD div inside another div, > and they both have the same id (i.e., "tabs-3"). So, either don't put the > LOAD inside a div, or make sure you give it a different id. Also, you don't > need to specify the '.load' in your f argument if you also specify the > extension argument (in that case, I think it will end up ignoring the > extension argument). > > > Second problem: > > In trying to find out if setting ajax to True was causing my first > > problem, I stumbled over a second. Setting 'ajax=False' or not > > setting ajax at all causes an exception. Could this be a bug? If so, > > please let me know where and how to report the thing. It's totally > > reproducible on my system. > > There is currently a bug with ajax=False where response.generic_patterns is > not getting passed to the component, so generic views are not working with > non-ajax components at the moment. If you're getting an invalid view error, > that could be the problem. > > Anthony
[web2py] Re: Two problems with LOAD; one may be a bug(?)
Thank you. I will fix that. On Jul 12, 7:57 pm, pbreit wrote: > Maybe try: > {{=LOAD('users', 'quals.load', args=(request.args(0)), ajax=True)}} > > The c= and f= are fine but not necessary. The extra ".load" is definitely > unnecessary and may have been causing the problem. You can insert .load in > either place but not both. > > If that works, try adding back the target. Also, as you have done, try it > with ajax=False.
[web2py] Re: Two problems with LOAD; one may be a bug(?)
On Tuesday, July 12, 2011 5:43:55 PM UTC-4, Cliff wrote: > > Running Version 1.97.1 (2011-06-26 19:25:44) > > First problem: > This is a snippet from a view file. It works except that it displays > the output of the quals function. Apparently it cannot find my > quals.load file and is using the generic load file in its place. > > > {{=LOAD(c='users',f='quals.load', > extension='load', args=(request.args(0)), > ajax=True, target='tabs-3')}} > Note, LOAD itself returns a div, and the id of that div is whatever you specify as the 'target' argument (if you don't specify 'target', it creates a random id). So, you're actually nesting the LOAD div inside another div, and they both have the same id (i.e., "tabs-3"). So, either don't put the LOAD inside a div, or make sure you give it a different id. Also, you don't need to specify the '.load' in your f argument if you also specify the extension argument (in that case, I think it will end up ignoring the extension argument). > Second problem: > In trying to find out if setting ajax to True was causing my first > problem, I stumbled over a second. Setting 'ajax=False' or not > setting ajax at all causes an exception. Could this be a bug? If so, > please let me know where and how to report the thing. It's totally > reproducible on my system. There is currently a bug with ajax=False where response.generic_patterns is not getting passed to the component, so generic views are not working with non-ajax components at the moment. If you're getting an invalid view error, that could be the problem. Anthony
[web2py] Re: Two problems with LOAD; one may be a bug(?)
Maybe try: {{=LOAD('users', 'quals.load', args=(request.args(0)), ajax=True)}} The c= and f= are fine but not necessary. The extra ".load" is definitely unnecessary and may have been causing the problem. You can insert .load in either place but not both. If that works, try adding back the target. Also, as you have done, try it with ajax=False.
[web2py] Re: Two problems with LOAD; one may be a bug(?)
I couldn't understand your setup clearly: what's the name of the controller file, the controller function, the views file ... Check that these are what they are supposed to be. You say you got an exception when ajax=False. What was the exception? On Jul 12, 5:43 pm, Cliff wrote: > Running Version 1.97.1 (2011-06-26 19:25:44) > > First problem: > This is a snippet from a view file. It works except that it displays > the output of the quals function. Apparently it cannot find my > quals.load file and is using the generic load file in its place. > > > {{=LOAD(c='users',f='quals.load', > extension='load', args=(request.args(0)), > ajax=True, target='tabs-3')}} > > > As you can see, the controller is 'users.' The 'quals.load' file is > in the 'views/users' directory, i.e. views/users/quals.load. > > There's not much in quals.load. Here's the whole thing: > > Qualifications required by the plan. > Hello, world. > {{=myreturn}} > > myreturn is the output from the quals function in the users > controller. > > Anybody got a clue as to what's happening? > > Second problem: > In trying to find out if setting ajax to True was causing my first > problem, I stumbled over a second. Setting 'ajax=False' or not > setting ajax at all causes an exception. Could this be a bug? If so, > please let me know where and how to report the thing. It's totally > reproducible on my system.